Re: How to do some AppleScript inside a Perl program to label duplicates
Re: How to do some AppleScript inside a Perl program to label duplicates
- Subject: Re: How to do some AppleScript inside a Perl program to label duplicates
- From: Doug McNutt <email@hidden>
- Date: Fri, 16 Sep 2005 10:02:20 -0600
At 13:47 +0100 9/16/05, pete boardman wrote:
>Anyone know how to run a bit of AppleScript from inside a Perl script?
Others have suggested Mac::Glue which is an object-oriented interface between perl and AppleScript, or at least Apple high level events. It's by Chris Nandor who is easily confused with our own Chris Nebel.
perl accepts the backtic (under the tilde on my keyboard) quoting construct meaning "execute the stuff between backtics as a system or shell command."
The CLI tool osascript allows ApleScript syntax to be compiled and executed from a command line.
Things like this appear regularly in my BBEdit worksheets.. They can also appear in a perl script if enclosed within backticks. (Well, there are sometimes the usual quoting problems.) The << operator is a UNIX "here" document.
osascript << ENDSCRIPT
tell application "Finder"
do something
end tell
ENDSCRIPT
Efficient it is not. But it is simple.
osascript can also be pointed to an existing file for execution and you can create it in /tmp/ on the fly.
man osascript # for more options.
--
--> From the U S of A, the only socialist country that refuses to admit it. <--
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden