Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parent property by "path to", passing variables between script files



Hi Philip,

Sorry for taking so long to respond, but thank you VERY much for your very
detailed response.  You are right about AS Studio needing an FAQ...  I would
pay a lot of money for a good book on it, but it seems like the only decent
book on it won't even be released until June.  Apple's documentation is
great to get started, but this list wouldn't have half the bewildered
questions it does if Apple's documentation were more complete!

> Now we come on to variables and this is where it gets tricky. My
> understanding is that when you load a script as I have outlined above
> you are actually loading
> a copy of the script. Therefore you can't set a variable in a script to
> something and then get that something out of the variable from the
> script that is loaded into another script (because, to all intents and
> purposes, it is a different script - a copy).
> 
> This makes it very difficult to keep track of values that you want to
> be "global to an application".

I am heeding all of your advice...  I especially appreciate your comments
about script loading actually loading a copy...  I am very close to a
solution because you have steered me off the wrong path and onto the right
one.

I do use the user defaults quite a bit, as well as data sources.  The main
elements that are not in these categories are:

- two lists of records that I use to supply the data sources via "append"
- globals that keep track of whether nibs are loaded, etc.

Because I need quick access to the master lists for filtering, etc. I can't
afford the overhead of writing to disk.  And my current method of moving the
globals into their respective sub-scripts has given me many headaches,
because of the inherent problems you mentioned.

Unless anyone can correct me, I believe I can accomplish what I need to do
by passing the master lists as parameters for handler calls, and moving the
"global to an application" variables (like the "nib loaded" booleans) back
into my main script.

Any other thoughts?

Thanks,
Graham Jones.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden

References: 
 >Re: Parent property by "path to", passing variables between script files (From: Philip Buckley <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.