In my application, I like the OSX Finder to copy a file or folder.
(Note: I have good reasons for using Finder instead of using cmds, NSWorkspace, or other means, so there is no need for suggestions in this direction.)
I am currently relying on Applescript to request the Finder to perform a copy operation. Here is a sample script for testing:
tell application "Finder"
try
copy file POSIX file "/etc/bashrc" to folder POSIX file "/private/tmp"
-- alternative with same behavior:
--duplicate POSIX file "/etc/bashrc" to POSIX file "/private/tmp"
on error errmesg number errn
display dialog "Error thrown: " & errmesg
end try
end tell
Now the problem is this: If the destination element already exists, the script throws an error and cancels the copy operation.
, , Finder " " , Finder , :

, :
script script Debugger, !
, , Finder , . ? ?