Re: Maintaining "State" information between scripts in an AS application
Re: Maintaining "State" information between scripts in an AS application
- Subject: Re: Maintaining "State" information between scripts in an AS application
- From: Emmanuel <email@hidden>
- Date: Sat, 2 Apr 2005 12:32:19 +0200
At 7:31 PM -0500 4/1/05, Thomas Berry wrote:
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.
Maybe you cannot choose to work with Smile. But if you can, then
probably you will find there a natural answer to all your concerns
above.
If you are interested in more information, I have selected the
following pages in the introductory pages about Smile:
<http://www.satimage-software.com/en/libraries.html>
<http://www.satimage-software.com/en/permanent.html>
Emmanuel
From Satimage-software, the authors of Smile
<http://www.satimage-software.com>
_______________________________________________
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