develooper Front page | perl.macosx | Postings from January 2002

Re: Perl and AppleScript Studio

Thread Previous | Thread Next
Chris Nandor
January 4, 2002 12:21
Re: Perl and AppleScript Studio
Message ID:
In article <>, (Michael Stearne) wrote:

> That's really cool.  I'm a lot better with Perl.  But I guess you don't 
> get any of the application tie ins like you do with AppleScript.

Sure you can.  Someone just needs to port the Mac:: modules, and then 
you'll have Mac::Glue, which can do nearly everything anything 
AppleScript can do (as far as controlling and talking to applications), 
using the same vocabulary (but with a Perl syntax).

   use Mac::Glue;
   $itunes = new Mac::Glue 'iTunes';

Mac::Glue works from MacPerl under Classic to control Mac OS X apps too, 
somewhat (I've not tested it extensively, and at least on problem 
involves the droplet to create the "glue" for an application doesn't yet 
understand Mac OS X apps).

In the case of iTunes, I created the glue using the Classic version of 
iTunes, and used it as above to control the Mac OS X version of iTunes, 
running MacPerl from Classic.

And like I said, if the Mac:: modules (AppleEvents, Events, etc.) are 
ever ported to Mac OS X, you'll be able to do the same under perl for 
Mac OS X.  I don't know when that will happen.  One thing is nearly 
certain: it will happen before I make the switch to Mac OS X as my main 
box.  :-)  But that might not be for quite some time.  Mac OS 9 is quite 
comfortable, and Mac OS X is not, for now.

Chris Nandor            
Open Source Development Network

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About