I have the following script which takes all the files in a folder moves them to another destination folder. However, If a file already exist with the same name, the script stops and won’t overwrite the file (which I want it to do). Is there a way to force it to overwrite it, or a better way to script this?
tell application "Finder"
set Destination to ((path to movies folder as text) & "destination folder:") as alias
set Source to ((path to movies folder as text) & "source folder:") as alias
try
set a_list to every file in Source as alias list
on error -- only one item present
set a_list to every file in Source as alias as list
end try
repeat with i from 1 to number of items in a_list
set a_file to (item i of a_list)
move a_file to Destination
end repeat
end tell