Mac::AppleScript - Perl extension to execute applescript commands on OS X
use Mac::AppleScript qw(RunAppleScript); RunAppleScript(qq(tell application "Finder"\nactivate\nend tell)) or die "Didn't work!";
Simple interface to the OSA scripting stuff.
Returns undef on error and sets $@ to the error code. Codes are listed in the AppleScript documentation. On successful completion, this returns the output of the AppleScript command. For empty returns, like with the sample script in the SYNOPSIS, AppleScript appears to return the string "{}" ( That's an open and close squiggle bracket, without the quotes)
None by default.
Dan Sugalski, dan@sidhe.org
Chunks of the code came from Apple Tech Notes, though that'll be cleaned out soon.
perl(1).
To install Mac::AppleScript, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mac::AppleScript
CPAN shell
perl -MCPAN -e shell install Mac::AppleScript
For more information on module installation, please visit the detailed CPAN module installation guide.