Re: Parents/Child Scripts
Re: Parents/Child Scripts
- Subject: Re: Parents/Child Scripts
- From: has <email@hidden>
- Date: Sat, 11 May 2002 10:52:47 +0100
Lachlan Deck wrote:
>
(a peek inside parent script)
[...]
>
try
>
set childScript to (load script <path to script> as alias)
>
tell childScript
>
receiveText(theText)
>
end tell
>
on error
>
display dialog "No such script."
>
end try
OT note: you need to be more specific with your error trapping. If an error
should occur within receiveText(), the user would actually see a "No such
script" error - this would be totally inappropriate. Instead, wrap the try
block around _only_ the code it directly applies to (in this case the 'load
script' line).
>
(inside child script) [...]
Anyway yeah, this is the approach commonly used to load and access AS-based
libraries [aka mods]. The 'load script' command makes a fresh copy of the
loaded script object. You can store this object within another script and
send messages to it.
I'm really not sure you can characterise this relationship as parent-child,
however. It's purely a containment thing where one object contains another.
[Maybe the experts could give a more definitive answer...]
-------
Michael Kelly wrote:
>
Maybe I'm way off-base here, but isn't the OP talking about parent and child
>
_scripts_? I.e., spawned processes.
Hmmmm... well you've got me. I don't know either.
Sounds like the OP needs to clarify his original question...
has
--
http://www.barple.connectfree.co.uk/ -- The Little Page of Beta AppleScripts
_______________________________________________
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.