Mac:: modules on Mac OS X
Che_Fox on #perl asked about controlling Mac OS X apps with Apple events from perl. As much as I would like to have the Mac::AppleEvents and companion modules ported to Mac OS X, it's not done. There needs to be some work done, and it needs some thought and organization, and I don't have time to do it. I hope someone else decides to. If not, someday I will. Maybe this year.
Anyway, you can control Mac OS X apps from MacPerl.
First, you launch Classic. Then, install the latest MacPerl, 5.6.1b3. Run two droplets in the Droplets folder, gluedialect and gluescriptadds. Then drop the Mac OS *9* version of the app, if possible, on gluemac. gluemac creates a vocabulary file, a glue file, for MacPerl to use to control the app; but it doesn't yet understand most Mac OS X apps.
So you do that, and then you can run things like:
Anyway, you can control Mac OS X apps from MacPerl.
First, you launch Classic. Then, install the latest MacPerl, 5.6.1b3. Run two droplets in the Droplets folder, gluedialect and gluescriptadds. Then drop the Mac OS *9* version of the app, if possible, on gluemac. gluemac creates a vocabulary file, a glue file, for MacPerl to use to control the app; but it doesn't yet understand most Mac OS X apps.
So you do that, and then you can run things like:
use Mac::Glue ':all';Controlling iTunes in Mac OS X from (Mac)Perl. Neat!
my $itunes = new Mac::Glue 'iTunes';
my $track = $itunes->get( $itunes->obj(tracks => gAll, playlist => 'Tom Petty') );
$itunes->play($tracks);
Leave a comment