Re: passing values from one script into a second script ?
Re: passing values from one script into a second script ?
- Subject: Re: passing values from one script into a second script ?
- From: email@hidden
- Date: Wed, 1 Aug 2001 10:15:25 -0400
On Tue, 31 Jul 2001 21:31:30 -0400, Bill Christens-Barry <email@hidden>
asked,
>
I'm still trying to resolve this. I need to use one script to run a
>
second, compiled script, with the first script passing a set of
>
values (strings, actually) to the script that it calls. Can anyone
>
provide a simple example of how to do this? If possible, I'd like to
>
avoid having the first script paste the arguments to the clipboard
>
and then having the second script get them from the clipboard. I also
>
like to avoid buffering the arguments in a file.
You can do this two ways: You can load one script into the other, or you can
have the second script be a separate application, and send it AppleEvents like
any application.
Embedded:
set embeddedScript to (load script alias "Disk:path:to:your:script"
tell embeddedScript to cogitate about "Life" since 1980
Application:
tell application "Separate application"
cogitate about "Life" since 1980
end tell
>
The reason for doing things this way is that I want to embed the
>
first script in an application (Object-Image) in a situation where
>
it's not appropriate to embed all of the scripting commands.
>
I can get one script to run the second script, but I don't know how
>
to pass string from the first script into the second. I haven't been
>
able to do this even if the first script is run using Script Editor
>
or as a compiled script (i.e. without any of the embedding issues).
The Script Editor doesn't respond to AppleEvents, and won't run the script in
response to another application. It might be nice if it could. I don't know if
one of the other development environments could do this. It doesn't make sense
to consider running a compiled script outside the context of an application.
Something has to be "the application".
--
Scott Norton Phone: +1-703-299-1656
DTI Associates, Inc. Fax: +1-703-706-0476
2920 South Glebe Road Internet: email@hidden
Arlington, VA 22206-2768 or email@hidden