我是Applescript的新手,我試圖將一個簡單的腳本放在一起來備份運行時的某些文件夾。我的腳本如下:使用Applescript備份一個文件夾
on run
tell application "Finder"
set backupFolder to make new folder at "BACKUP" with properties {name:(year of (current date) as string) & "-" & (month of (current date) as integer as string) & "-" & (day of (current date) as string)}
duplicate folder "~/Test" to backupFolder
end tell
end run
然而,當我運行該腳本我收到一個錯誤,指出:
Finder got an error: Can’t set folder "2013-1-9" of disk "BACKUP" to folder "~/Test".
這似乎是這樣一個很重要的問題,但我不知道如何要解決這個問題。任何人都可以讓我知道我做錯了什麼?
提示:%F是快捷鍵%Y-%間%d。所以:d =〜/ Backup/$(日期+%F)/ –