我試圖找出創建能夠定期爲應用程序做一些維修用的文件夾中運行一個AppleScript最簡單的方法。的AppleScript根據其名字的文件夾移動到網絡文件夾
例如: 有桌面上的2個文件夾。一個被命名爲「George Project」,另一個被命名爲「Rocco項目」。
我需要將任何文件夾及其各自的包含George的子文件夾移動到網絡驅動器上的george文件夾(/ Volumes/AMT/George),以及包含Rocco等任何文件夾的相同內容。
所有這些命名的文件夾中僅會在2個位置,所以我想這個腳本來檢查包含這些名稱的任何文件夾兩個位置,並將其移動到網絡上的正確位置。
到目前爲止,我已經盡我的本地驅動器上運行此腳本,但它實際上並沒有移動任何東西:在移動指令
global theWatchedFolder
set theWatchedFolder to choose folder
on idle
tell application "Finder"
set theDetectedItems to every item of theWatchedFolder whose name contains "rocco"
repeat with aDetectedItem in theDetectedItems
move aDetectedItem to "/Users/Rocco/Test"
end repeat
end tell
return 1
end idle