Modifications and Variables
Modifications and Variables
- Subject: Modifications and Variables
- From: Paul Berkowitz <email@hidden>
- Date: Thu, 02 Jan 2003 21:09:56 -0800
I'm making an applet for someone who needs to have it on the main OS X disk,
not in the user sector, where it can be run by any user on a network. The
users will not have write privileges there, however, so it can't be
modified. I therefore replaced script properties by external text files in
the user sector: the script writes string lists of data to the text file,
and reads it back on next run.
Nevertheless, even after removing all properties and globals, the script was
showing a new modification date every time it ran, even when run-only. By
explicitly declaring every top-level variable (every single variable in the
run handler) as local, I succeeded in avoiding any modifications to the
script file.
So it seems that every undeclared variable in the run handler, not just
declared globals (which I knew about) and properties, is persistent, even if
its scope is local to the run handler. (What put me on to this is the fact
that when you open a script in Script Debugger you can read all the values
of every top-level variable from its last run.) How odd. What's it for?
Does anyone know for certain if this sort of saving of new values at the end
of a script run is indeed something that would create an error if the script
was run by a user with execute but not write privileges? Naturally, I've
declared all the variables as local in the meantime, but I'm interested to
know if anyone has first-hand experience?
--
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.