我完全陷入了applescript问题。尝试使用它来自动从远程FTP服务器上的文件夹下载到本地文件夹。下载完成后,我想将服务器上的文件移动到一个子文件夹中,这样便无法再次下载它们。代码如下:
tell application "Transmit"
set SuppressAppleScriptAlerts to true
set Favourite to item 1 of (favorites whose name is "Auto-Sync")
set myRules to (skip rules whose enabled is true)
tell current tab of (make new document at end with properties {name:"ActiveAutoSync"})
connect to Favourite
refresh remote browser
refresh local browser
tell remote browser
if exists "__AutoCollected" then
--
else
create folder named "__AutoCollected"
end if
end tell
repeat while (exists document "ActiveAutoSync" of application "Transmit")
with timeout of 3600 seconds
synchronize remote browser to local browser using skip rules myRules with compare using size and follow symlinks
end timeout
set folderName to ("__AutoCollected")
tell remote browser
set theFiles to (the name of every browser item whose item type is file item)
repeat with thisFile in theFiles
move (file whose name is thisFile) to folder whose name is folderName
end repeat
end tell
delay 30
end repeat
end tell
end tell
一切都会运行文件,直到我点击 move 行。我尝试了数组的各种组合,将其设置为字符串,别名等,但是每次它都是一个不同的错误-主要是
无法获取名称为{\“ file1.JPG \”,\“ file2.JPG \”, \“ file3.JPG \”
我怀疑Transmit的move命令与我惯用的有所不同,但是我只是无法从Dictionary的文档中弄清楚。有人知道吗?
谢谢。