Duplicate a file ... Not working on Tiger..


I am new to apple script. I am using some legacy script file to create an application pkg. This is working fine on Jaguar and panther. The script is failing on Tiger. Any kind of help in this regard is highly appreciated.


rm -rf /tmp/license.*

/usr/bin/osascript <<END

tell application “Finder”
display dialog “License Server requires a license file. Please choose one:” buttons {“OK”, “Cancel”} default button 1
if the button returned of the result is “OK” then
choose file with prompt “Please choose a license file:”
set the_file to the result
duplicate the_file to “tmp” with replacing
set the_file to the result
set the name of the_file to “license.dat”
end if
end tell


if [ -f /tmp/license.dat ]
exit 0

exit -1

Thanks in advance,


duplicate file the_file to "tmp" with replacing

Hi Reikon,

I tried with your suggestion. This didn’t work on tiger.



The correct Finder line should be:

duplicate the_file to folder "tmp" with replacing

This will only work if “tmp” is a folder on the desktop, otherwise you have to supply the full Mac OS path or a full Finder reference.

The code outside your Finder ‘tell’ block isn’t AppleScript ” though perhaps you already knew that. :slight_smile: