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

Hi,

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.


#!/bin/sh

rm -rf /tmp/license.*

/usr/bin/osascript <<END

tell application “Finder”
activate
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

END

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

exit -1

Thanks in advance,
-Subbarao

Try:

duplicate file the_file to "tmp" with replacing

Hi Reikon,

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

Thanks…

Hi.

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: