Re: Load Script
Re: Load Script
- Subject: Re: Load Script
- From: Luther Fuller <email@hidden>
- Date: Fri, 03 Jun 2011 16:31:42 -0500
I've done a little more experimenting. The parent script contains ...
property prefsName : "com.LutherFuller.DiskImageTools" -- = CFBundleIdentifier
and opens a "Test" script file with ...
(path to resource (scriptName & ".scpt") in directory "MenuItemScripts") as alias -- where scriptName = Test run (load script the result)
If the file "Test.scpt" is ...
on run my testHandler() end run
on testHandler() prefsName display dialog the result buttons {"OK"} default button 1 end testHandler --------------------
Then there is an error because the property prefsName is not available. This problem is corrected by changing the script to ...
on run my testHandler(prefsName) end run
on testHandler(x) display dialog x buttons {"OK"} default button 1 end testHandler --------------------
The conclusion is that properties of the parent are available in the 'run' handler of the child script ... ONLY! The parent's properties are not available within a handler in the child script ... even if you use 'my', 'of me' or 'of my parent'.
|
_______________________________________________
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