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 Topher,

Thanks for the quick response.  Actually, loading the scripts is the easy
part...  I already had a very similar loading routine called from my awake
from nib, and the script files load successfully.  I can run the subscripts'
handlers with no problems.

My challenge is setting the parent property.  I wish your method worked for
me...  But I get this error:

- Can't set parent of missing value to <<script>>. (-10006)

Any ideas?

Thanks,
GJ

> I'd save each script in the Scripts folder of the main bundle, and then use
> "path for" to set the properties during a very early launch event (like will
> finish launching or awake from nib).
> 
> /*Main Script*/
> property subscript1: missing value
> property subscript2: missing value
> property subscript3: missing value
> 
> on will finish launching theObject
>   tell main bundle
>       set my subscript1 to load script (path for script "subscript1"
> extension "scpt")
>       set my subscript2 to load script (path for script "subscript2"
> extension "scpt")
>       set my subscript3 to load script (path for script "subscript3"
> extension "scpt")
>   end tell
>   set subscript1's parent to me
>   set subscript2's parent to me
>   set subscript3's parent to me
> end will finish launching
> 
> ...
> 
> /*Sub Scripts*/
> property parent: missing value
> 
> ...
> 
> This way you can load each of your subscripts into a property, and then you
> can just use tell blocks to call any of their handlers and functions.
> 
> Here is some reference material that could be of use:
> http://developer.apple.com/documentation/AppleScript/Reference/StudioReferen
> ce/sr3_app_suite/chapter_3_section_29.html
> http://developer.apple.com/documentation/AppleScript/Conceptual/AppleScriptL
> angGuide/AppleScript.d6.html
> 
> Hope this is helpful.
> 
> Topher

 _______________________________________________
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



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.