Mac:: modules on Mac OS X

| | Comments (0)
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:

    use Mac::Glue ':all';
    my $itunes = new Mac::Glue 'iTunes';
    my $track = $itunes->get( $itunes->obj(tracks => gAll, playlist => 'Tom Petty') );
    $itunes->play($tracks);

Controlling iTunes in Mac OS X from (Mac)Perl. Neat! use.perl.org

Leave a comment

<pudge/*> (pronounced "PudgeGlob") is thousands of posts over many years by Pudge.

"It is the common fate of the indolent to see their rights become a prey to the active. The condition upon which God hath given liberty to man is eternal vigilance; which condition if he break, servitude is at once the consequence of his crime and the punishment of his guilt."

About this Entry

This page contains a single entry by pudge published on January 7, 2002 8:36 PM.

MacPerl 5.6.1b3 was the previous entry in this site.

What Am I Missing? is the next entry in this site.

Find recent content on the main index or look in the archives to find all content.