• 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: How to call a Perl script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to call a Perl script


  • Subject: Re: How to call a Perl script
  • From: Ricardo Montiel <email@hidden>
  • Date: Mon, 02 Jul 2001 16:24:24 -0300

on 02 Jul 2001 09:50, Katherine Richmond at email@hidden
wrote:

> I need to call a Perl script from an AppleScript. I am trying it like this:
>
> tell application "Finder"
> activate
> tell application "MacPerl"
> DoScript("parseCernerFiles2.pl")
> end tell
> end tell
>
> I can run the Perl script with no problems, but when I ask AppleScript to do
> it, I get this error:
>
> "MacPerl got an error. Can't continue DoScript." Is there something about the
> interaction between AppleScript and MacPerl that I am overlooking?
>
> On page 249 of Chris Nandor's 'MacPerl Power and Ease', there is an example of
> calling MacPerl from AppleScript. It looks like you have to put the entire
> perl script inside the AppleScript? Is this the only way to do it?


Hi Kathy,

MacPerl expects the full path to the perl script and any required parameter
in a list, so see a little more complex example (watch for wrapped lines):


set xParamText to text returned of (display dialog "Your Note" default
answer "A Reply")
set xParamFile to choose file with prompt "Your File:" of type {"TEXT"}
set xPath to "your_disk:your_folder:parseCernerFiles2.pl"

tell application "MacPerl.PPC"
activate
Do Script {xPath, xParamText, xParamFile}
end tell


Also, there is no need to tell the Finder.

I hope this helps,


Saludos (Regards),
-- Ricardo Montiel
Buenos Aires, Argentina

PS: Please cc me, on digest.


  • Prev by Date: RE: Rot 13
  • Next by Date: RE: Yippie! Just got my AS in a Nutshell book
  • Previous by thread: Re: Disk Copy SMI without checksum verification
  • Next by thread: Re: How to call a Perl script
  • Index(es):
    • Date
    • Thread