Re: Calling other OSA Scripts
Re: Calling other OSA Scripts
- Subject: Re: Calling other OSA Scripts
- From: Chris Nebel <email@hidden>
- Date: Thu, 24 May 2001 14:58:45 -0700
- Organization: Apple Computer, Inc.
g3pb wrote:
>
tell application "MacPerl"
>
Do Script "
>
for($x=0; $x < 10; $x++) {
>
print \"x is $x\\n\";
>
}
>
"
>
end tell
>
>
tell application "MacPerl"
>
Do Script "iMac:Desktop Folder:test.pl" -- path to perl script file
>
end tell
It's worth pointing out that while this works, it's not exactly what Kevin
asked about. OSA provides a generic interface to scripting languages, so
that given some source text, you can compile it and store it, and then given
a OSA compiled script blob, you can load it and execute it. To do this,
though, you need an OSA-compliant version of the language in question. Once
you do, you can use "run script" like this:
run script "for ($x=0; (etc.)" in "Perl"
Doing this same thing from another OSA language presumes that they have some
equivalent to "run script", which most of them do. Unfortunately, I don't
think there's an OSA Perl implementation, so the MacPerl route is the way to
go.
--Chris Nebel
AppleScript Engineering