• 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: Calling other OSA Scripts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calling other OSA Scripts


  • Subject: Re: Calling other OSA Scripts
  • From: Nigel Smith <email@hidden>
  • Date: Thu, 24 May 2001 17:15:44 +0100

g3pb wrote:
>tell application "MacPerl"
> Do Script "iMac:Desktop Folder:test.pl" -- path to perl script file
>end tell

And I've just found something else (though it may be obvious to anyone with
more than my 10 minutes of MacPerl experience :-) ).

A simple MacPerl script:
$a = $ENV{myVar};
MacPerl::Reply($a)

And a simple AppleScript:
tell application "MacPerl"
set myResult to Do Script scriptPath environment {"myVar", "Banana"}
end tell
return myResult

If you save the MacPerl script and replace "scriptPath" in the Applescript
with the path to the MacPerl script, then run the AppleScript, it will
return "Banana".

OK, not the most exciting result in the world, but it's made my day :-)

And I've just found that you can go on, listing more variables in the form
{varName1,value1,varName2,value2,varName3,value3, ... ,varNameN,valueN}

I always thought you could use MacPerl in a way similar to Unix, assign a
command line argument when you run the script. Looks like I was wrong,
thanks to AppleScript...

Nigel (the easily pleased!)


References: 
 >Re: Calling other OSA Scripts (From: Kevin Diffily <email@hidden>)
 >Re: Calling other OSA Scripts (From: g3pb <email@hidden>)

  • Prev by Date: Re: applescript-users digest, Vol 2 #697 - 11 msgs
  • Next by Date: Re: Classic vs OSX osax
  • Previous by thread: Re: Calling other OSA Scripts
  • Next by thread: Re: Calling other OSA Scripts
  • Index(es):
    • Date
    • Thread