简体   繁体   English

AppleScript复制文件

[英]AppleScript to copy files

I have an Applescript to copy files from one directory to another with replacing files in the destination automatically. 我有一个Applescript,可以通过自动替换目标位置中的文件将文件从一个目录复制到另一个目录。 I keep getting an error that Finder can't every file of the source directory. 我不断收到一个错误消息,Finder不能列出源目录的每个文件。 What am I doing wrong? 我究竟做错了什么? Thanks for your input! 感谢您的输入!

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

在此行中,将“文件夹”一词放在source2的前面...

duplicate files of source2 to folder destination2 with replacing

我建议您使用do shell脚本命令,而不要使用Finder应用程序,因为它是更灵活的解决方案

do shell script "cp /Users/lisa.reed/Documents/ProPresenter5/* <path_to_destination>"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM