set pathToFileWork to "HD:Users:USER:Desktop:File.rtf"
set pathToFolderBackups to "HD:Users:USER:Desktop:Folder:"
try -- trap Finder duplicate error
tell application id "MACS" to set Dup to duplicate alias pathToFileWork to folder pathToFolderBackups
end try
When run from the Editor all is well: after the 1st run the error is suppressed.
However, when run as an applet an alert pops up after the 1st run, asking if I want to overwrite | stop | keep both.
This is what an application should do, but it seems it happens outside AppleScript, as the try block is ignored.
I’m thinking I should test for the presence of a duplicate, instead of using a try block.
Is there another solution?
(The actual script with this code keeps running after I dismiss the alert, but I just don’t want to see it.)