Re: "Save changes to script" when it terminates?
Re: "Save changes to script" when it terminates?
- Subject: Re: "Save changes to script" when it terminates?
- From: Graff <email@hidden>
- Date: Sun, 14 Mar 2004 03:19:33 -0500
On Mar 13, 2004, at 12:23 PM, Chap Harrison wrote:
On Mar 13, 2004, at 4:29 AM, Nigel Garvey wrote:
If you need global behaviour - where either it's inconvenient to keep
passing parameters or the handlers need to be able to change the
values
of "top level" variables - you could put the entire working code of
the
script into a script object in a handler. The "globals" would then
have
to be properties of that script object:
[snip]
Thanks, Nigel -- this does exactly what I wanted. Some of the
"globals" had to be modified by the script or by handlers. And thanks
to Paul and Michelle for your replies, too.
At some point I expect I'll discover the value of having a script
preserve state across launches, but so far it has only bitten me, and
it's good to know how to avoid it.
There is great value in having a script be able to save state between
launches, the only problem is that it is automatic and pops up even
when you don't need it. I think that it would be better if you had to
save state explicitly, perhaps either by executing a "save state"
command or by having a special saved state variable. For example:
global theVar -- a global variable that does not save state
stored theVar -- a global variable that does save state
With this sort of variable we could avoid the whole mess of "is this
saved state or is it not?" I don't know if it is possible to easily
add this to AppleScript but it definitely would make things much
clearer.
-Ken
_______________________________________________
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.