• 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: Parents/Child Scripts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: Parents/Child Scripts
  • Next by Date: Re: Reversing the lines in a file[speed, stack overflow}
  • Previous by thread: Re: Parents/Child Scripts
  • Next by thread: Re: Parents/Child Scripts
  • Index(es):
    • Date
    • Thread