Re: Scripts inside Scripts
Re: Scripts inside Scripts
- Subject: Re: Scripts inside Scripts
- From: email@hidden (Michael Sullivan)
- Date: Thu, 4 Jul 2002 23:24:46 -0400
- Organization: Society for the Incurably Pompous
email@hidden (Mario Kolaszewski) wrote:
>
Is there a way to have a script seating idle within a script waiting to be
>
called upon. ex if... then execute "this" script,
>
else execute "that" script.
>
The reason for this is the necessity to use the existant variables
>
and their values from the host script.
Yes. It's hard to say exactly what you're looking for but pretty much
whatever it is, there's a way to do it.
Are you just looking for functions that can access variables at the
scope of the main script? There are a number of ways to do that. The
easy answer is one that I am loathe to even mention, which is "make the
variables you are trying to access global."
One tip is that there are *always* ways to avoid doing that, and it is
almost always good programming practice to do so. The more you can
avoid putting top-level side effects into your functions, the easier it
is to debug your programs.
More on point: I feel like I could give you a whole tutorial on AS
script objects and scoping rules and practices, but still not
necessarily give you a good way to work, while giving you lots of arcana
that you may not be prepared to absorb.
If you could post a specific problem or a scriptlet that you're having
difficulty with, I (or others, since I am out of the office and may not
look here again until Monday) may be able to give you a better targeted
and hands on answer.
Michael
_______________________________________________
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.