我有一个Applescript将文件从一个目录复制到另一个目录,并自动替换目标中的文件。我不断收到Finder可以查看源目录中每个文件的错误。我究竟做错了什么?感谢您的投入!
set source to "Edit System:Users:lisa.reed:Library:Application Support:RenewedVision:ProPresenter5:Playlists:Sanctuary.pro5pl"
set destination to "WorshipMedia:ProPresenter Data:__Playlist_Data"
set source2 to "Edit System:Users:lisa.reed:Documents:ProPresenter5"
set destination2 to "WorshipMedia:ProPresenter Data:__Documents:Sanctuary"
tell application "Finder"
duplicate file source to folder destination with replacing
duplicate files of source2 to folder destination2 with replacing
end tell
答案 0 :(得分:2)
在此行中将“folder”放在source2前面......
duplicate files of source2 to folder destination2 with replacing
答案 1 :(得分:0)
我建议您使用执行shell脚本命令而不是使用Finder应用程序,因为它是更灵活的解决方案
do shell script "cp /Users/lisa.reed/Documents/ProPresenter5/* <path_to_destination>"