Re: Load Script
Re: Load Script
- Subject: Re: Load Script
- From: Stan Cleveland <email@hidden>
- Date: Wed, 25 May 2011 12:04:48 -0700
On May 25, 2011, at 8:51 AM, Luther Fuller wrote:
> Suppose scriptA contains this line ...
>
> set scriptB to load script ...
>
> I have been looking and as far as I can tell, there is no way for scriptB to call handlers in scriptA.
> Obviously, my scriptA contains common handlers that I want to be available to scriptB, scriptC, scriptD, ...
>
> In order to do what I need, I think I will need to put all common handlers into a loadable script, then
> scriptA loads scriptB which loads commonHandlers.
>
> Or, did I miss something?
> Is there any way for a loaded script to call handlers in the parent loading script?
Hi Luther,
The following method works, but may not be exactly what you're looking for:
Save scriptB with the following content:
property scriptA : missing value
scriptA's displayDialog("Hello")
Then scriptA would contain:
set scriptB to load script alias "MacHD:path:to:scriptB.scpt"
set scriptB's scriptA to me
run scriptB
on displayDialog(theMessage)
display dialog theMessage
end displayDialog
Stan C.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
References: | |
| >Load Script (From: Luther Fuller <email@hidden>) |