我想制作一个读取文本文件的AppleScript文件,并且每行都将文本复制到剪贴板(从这里开始对它进行排序),然后移到下一行并将其复制到剪贴板。谢谢!
答案 0 :(得分:4)
# Determine the input file's path.
set srcFile to ((path to desktop) as text) & "myFile.txt"
# Read lines from file.
set lns to paragraphs of (read file srcFile as «class utf8»)
# Loop over lines read and copy each to the clipboard.
repeat with ln in lns
set the clipboard to ln
display alert (the clipboard)
end repeat