Re: scripting MacPerl question
Re: scripting MacPerl question
- Subject: Re: scripting MacPerl question
- From: Ricardo Montiel <email@hidden>
- Date: Wed, 04 Jul 2001 18:05:41 -0300
on 3 Jul 2001 22:56, Ingo Bitsch at <email@hidden> wrote:
>
can anybody tell me the basic mechanism how to let an Applescript
>
pass data to a MacPerl Script, let the MacPerl process the data
>
and return the result back to the AppleScript?
Hi Ingo,
See the following example, where MacPerl catches an AppleScript variable,
process it and returns the new value. I think the example is
self-explanatory.
-- Begin Script ---------
set xText to "Tixto di pruiba"
tell application "MacPerl.PPC"
set xProcess to "
$_ = $ARGV[0];
s/i/e/g;
print;"
set xProcessedText to ,
Do Script {xProcess, xText} mode Batch
end tell
display dialog xProcessedText with icon 1
-- End Script -----------
But I rarely use this approach - I only use it in the simple kind of process
as the described above. For complex text manipulation routines or those ones
that require to process large volumes of text, the MacPerl Scripts will run
the last (or read the file from disk) and the result will be written to
disk. So there is no need to receive and to send variables and results from
or to AppleScript.
I hope this helps.
Saludos (Regards),
-- Ricardo Montiel
Buenos Aires, Argentina
PS: Please cc me, on digest.