我不是专业的程序员,而是一个相当大的项目的艺术总监,我每天都会做很多重复性的任务。一个常量是将文件移动到团队成员的文件夹中。我希望能够选择一些文件并出现一个菜单供我选择接收文件的人。
我取得了一些进展,但被卡住了。脚本找不到我想要文件去的目录。我担心它与 POSIX 路径有关 - 或者我没有将它定义为文件夹而不是文件?错误内容如下:
错误“找不到文件 /Volumes/Workbench/Test/CookieMonster。” 来自“/Volumes/Workbench/Test/CookieMonster”的数字 -43
...即使你有一个文件夹,它说没有。我怀疑我的语法不正确。
set currentFolder to path to (folder of the front window) as alias
on error -- no open windows
set the currentFolder to path to desktop folder as alias
end try
set artistList to {"CookieMonster", "BigBird", "Bert", "Ernie", "Grouch"}
set assignTo to {choose from list artistList with title "Assign to..." with prompt "Please choose" default items "Bert"}
set assignedArtist to result
set artDeptDir to "/Volumes/Workbench/Test/"
set filePath to {artDeptDir & assignedArtist}
set destinationFolder to filePath as alias
set selected_items to selection
repeat with x in selected_items
move x to folder of filePath
end repeat
如果有人了解我的问题,我很乐意听取他们的意见。感谢您抽出时间来阅读。