• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Load Script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: Load Script
  • Next by Date: Re: For some strange reason
  • Previous by thread: Re: Load Script
  • Next by thread: Re: Load Script
  • Index(es):
    • Date
    • Thread