Mark
Mark

Reputation: 1

AppleScript to copy files

I have an Applescript to copy files from one directory to another with replacing files in the destination automatically. I keep getting an error that Finder can't every file of the source directory. 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

Upvotes: 0

Views: 4954

Answers (2)

Victor Sharovatov
Victor Sharovatov

Reputation: 633

I suggest you to use do shell script command instead of using Finder application as it's more flexible solution

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

Upvotes: 0

regulus6633
regulus6633

Reputation: 19032

Put the word "folder" in front of source2 in this line...

duplicate files of source2 to folder destination2 with replacing

Upvotes: 2

Related Questions