Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

pudge (1)

  (email not shown publicly)
AOL IM: Crimethnk (Add Buddy, Send Message)

I run this joint, see?

Journal of pudge (1)

Monday January 07, 2002
11:36 PM

Mac:: modules on Mac OS X

[ #1973 ]

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') );

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

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • iHam [] on iRye :)

    • Heh, cool software, and funny. Too bad there's no Mac OS 9 client.

      The text below, which I sometimes add to the bottom of my posts, is gotten using MacPerl with Mac::Glue on Mac OS 9 to query the iTunes player on the Mac OS X box. A little key command and I'm good to go!

      NP: When I Fall - Barenaked Ladies (Born On A Pirate Ship)