Re: Date Modified
Re: Date Modified
- Subject: Re: Date Modified
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 22 Feb 2004 10:14:22 -0800
On 2/22/04 9:34 AM, "Robert Poland" <email@hidden> wrote:
>
I'm sure this has been beat to death sometime in the distant past...
>
>
What is the purpose of "Date Modified"? It doesn't seem to have any
>
real meaning. Every time a script is run the "Date Modified" gets
>
changed.
>
>
On a related note, doesn't that mess up any backup process? How would
>
the backup process know which is the latest version?
All top-level variables (variables defined in the top-level of a script, the
implicit or explicit run handler) not explicitly declared local, are
actually globals aside form the scope issue (they're not recognized within
subroutines as globals). But they do get retained between runs, as all
globals do, just like properties. That means that their value at the end of
a script run is different than at the beginning, generally, so the script
has been modified.
If it's ever important to you NOT to have a script modified when run - for
example, when you know that the script may be stored in Applications folder
or anywhere outside the user folder, where the user may not have write
permissions, then you should declare every single variable in the top level
or run handler as local. That way they pass out of existence when the script
ends. You should have no globals or properties : write your preferences to a
text file outside the script and read them from there.
I had to do this rigorously once for someone who wanted a script that could
be run on multiple users' computers from an Applications subfolder on a
server somewhere where they had no write permissions. It never got its
modification date changed and never had any problem with permissions.
--
Paul Berkowitz
_______________________________________________
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.