【发布时间】:2018-01-17 01:00:30
【问题描述】:
我创建了一个 droplet,它允许我从输入框中重命名文件。
on adding folder items to este_folder after receiving este_file
display dialog "what's their name?" default answer ""
set text_returned to text returned of the result & ".jpg"
display dialog text_returned
tell application "Finder"
set the name of file este_file to text_returned
end tell
end adding folder items to
它工作正常,但它创建了一个循环,我必须再次点击取消来停止脚本,因为它认为已添加了一个新文件。我只想重命名一次;然后不再弹出第二个对话框。我已尝试将文件重新路由到另一个文件夹:
on adding folder items to este_folder after receiving este_file
display dialog "what's their name?" default answer ""
set text_returned to text returned of the result & ".jpg"
display dialog text_returned
tell application "Finder"
set the name of file este_file to text_returned
end tell
repeat with anItem in este_file
tell application "Finder"
set destFolder to "Macintosh HD:Users:maxwellanderson:Desktop:BetterinTexas" as alias
move anItem to folder destFolder
end tell
end repeat
end adding folder items to
但这也不起作用——它不处理脚本的重命名部分。关于我应该如何摆脱第二个对话框的任何建议?
【问题讨论】:
标签: applescript directory finder