• 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: exchanging data with perl scripts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: exchanging data with perl scripts


  • Subject: Re: exchanging data with perl scripts
  • From: Alex Robinson <email@hidden>
  • Date: Tue, 18 Jun 2002 03:32:06 +0100

>I have an idea for a little Applescript applet that involves
>manipulating texts. My friend is writing perl scripts for the text
>manipulation. I have been reading up and feel like I can get nearly
>everything done on the interface side using applesript studio. I just
>need to exchange text strings and results between perl scripts and AS on
>OS X. I haven't really found anything on the subject that I understand.
>Does anyone have suggestions for places that I can learn more?

You can invoke the perl scripts using "do shell script" either directly

do shell script "perl -e 'print q[hello world];'"

or (probably more usefully to you) by invoking scripts

do shell script "PATH_TO_SCRIPT"

where PATH_TO_SCRIPT is the full path to the script you want to invoke.

You can pass arguments to the script by placing them afterwards as normal
and access them using the usual ARGV variables that your friend should be
familiar with

do shell script "PATH_TO_SCRIPT arg1 arg2 arg3"

To get stuff back from the script, whatever you print to STDOUT will be
returned to AppleScript


You might also want to check out CamelBones which allows you to write Cocoa
apps in Perl (although the documentation is sadly lagging behind)
http://camelbones.sourceforge.net/
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Application event dict error
  • Next by Date: Re: Events that halt system shutdown
  • Previous by thread: exchanging data with perl scripts
  • Next by thread: Application event dict error
  • Index(es):
    • Date
    • Thread