Re: osascript and Modification Date of Compiled Script
Re: osascript and Modification Date of Compiled Script
- Subject: Re: osascript and Modification Date of Compiled Script
- From: Paul Berkowitz <email@hidden>
- Date: Thu, 18 Mar 2004 10:11:20 -0800
On 3/18/04 9:27 AM, "Jeffrey Berman" <email@hidden> wrote:
>
Thanks to everyone who responded to my question about running a compiled
>
AppleScript from a Unix shell using the 'osascript' command without altering
>
the modification date of the script file.
>
>
Because the scripts I will be running can have properties and subroutines
>
using global variables, the approach of making all variables local is not a
>
solution for my situation. Using the shell 'cp' command to create a
>
temporary copy of the script and then running the copy would work. However,
>
the suggestion to use the -e option on 'osascript' seems simpler, as in:
>
>
osascript -e 'run script (POSIX file "'$HOME'/Desktop/TestScript")'
>
>
The above command runs the script file without changing the modification
>
date, whether or not there are global variables in the script. In contrast,
>
the file modification date is changed if the command is:
>
>
osascript ~/Desktop/TestScript
'run script' loads a copy into memory and runs that, so it won't affect the
file itself, true. It sounds like your best bet. (Perhaps 'load script' and
'run' the result also would work, but you might need just a single line for
the -e option of osascript, so 'run script' is best).
--
Paul Berkowitz
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.