• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: "Save changes to script" when it terminates?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >Re: "Save changes to script" when it terminates? (From: Nigel Garvey <email@hidden>)
 >Re: "Save changes to script" when it terminates? (From: Chap Harrison <email@hidden>)

  • Prev by Date: Re: finding newest file in a folder
  • Next by Date: Re: finding newest file in a folder
  • Previous by thread: Re: "Save changes to script" when it terminates?
  • Next by thread: Re: "Save changes to script" when it terminates?
  • Index(es):
    • Date
    • Thread