【发布时间】:2018-04-14 22:25:57
【问题描述】:
美好的一天。
我有一个基本的applescript,它将最旧的文件从一个文件夹移动到另一个文件夹。我正在从命令行运行 applescript:
osascript /Users/dmayo/Documents/scripts/MoveOldest.scpt
我也有脚本标准输出到终端,但似乎不能只引用文件名。这是我在代码log this_item 中得到的:
«class docf» 2016-04-12-01-31-31.pdf of «class cfol» 2013-long of «class cfol» Scans of «class cfol» dmayo of «class cfol» Users of «class sdsk»
我只想要输出的每一行的文件名“2016-04-12-01-31-31.pdf”。这是我的 Applescript:
repeat
tell application "Finder"
set src to folder "Macintosh HD:Users:dmayo:Scans:2013-long"
set dest to folder "Macintosh HD:Users:dmayo:Scans"
set sorted_list to sort items of src by creation date
set this_item to item 1 of sorted_list
move item 1 of sorted_list to dest
log this_item
end tell
delay 120
end repeat
谢谢。
【问题讨论】:
标签: terminal applescript