• 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: scripting MacPerl question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Prev by Date: Re: References and subroutines
  • Next by Date: Re: Transactions parameter
  • Previous by thread: Re: akua sa
  • Next by thread: Re: scripting MacPerl question
  • Index(es):
    • Date
    • Thread