Re: exchanging data with perl scripts
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.