The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Mac::AppleScript - Perl extension to execute applescript commands on OS X

SYNOPSIS

  use Mac::AppleScript qw(RunAppleScript);
  RunAppleScript(qq(tell application "Finder"\nactivate\nend tell))
    or die "Didn't work!";

DESCRIPTION

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)

EXPORT

None by default.

AUTHOR

Dan Sugalski, dan@sidhe.org

Chunks of the code came from Apple Tech Notes, though that'll be cleaned out soon.

SEE ALSO

perl(1).