• 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
Maintaining "State" information between scripts in an AS application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Maintaining "State" information between scripts in an AS application


  • Subject: Maintaining "State" information between scripts in an AS application
  • From: Thomas Berry <email@hidden>
  • Date: Fri, 01 Apr 2005 19:31:29 -0500

Last week I asked for, and received, a solution to a question I had about how to locate and call handlers in scripts other than the one that is currently running. Thanks to Paul Berkowitz for helping me out.

Now I've got a question about how to maintain the state of a script property between Applescripts. My application consists of several scripts, each tied to which tab is selected in a tab view on the interface. Although each tab has a specific function (for example, one controls music and another controls video), they have a need to call a common routine (e.g. call a handler to speak the command just selected, such as "Play"). There are other common routines that need to be called as well and I'd rather not code each one in to the script for each tab as that would make debugging and maintenance quite tricky.

I'd rather code the common routines into a "Common Library" script and call them as I need them. Paul showed me how to locate and call a handler from a script, including how to do that using a property. It worked perfectly. Trouble is, I'd need to code that routine into EACH script for each tab in my app. What I need is a way to initialize the variable that defines the script on application launch and then maintain its state such that I would be able to call it from a different script.

I've been searching unsuccessfully to see if there is a way to define and access some type of "uber" variable within an AS application, but most discussions I've found refer to doing this within the SAME script. Any help is appreciated.


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Maintaining "State" information between scripts in an AS application
      • From: Emmanuel <email@hidden>
  • Prev by Date: Re: folder order
  • Next by Date: File Properties as string
  • Previous by thread: Call another script
  • Next by thread: Re: Maintaining "State" information between scripts in an AS application
  • Index(es):
    • Date
    • Thread