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

Re: Perl and AppleScript Studio

Thread Previous | Thread Next
From:
Chris Nandor
Date:
January 4, 2002 12:21
Subject:
Re: Perl and AppleScript Studio
Message ID:
pudge-BC0265.15215504012002@onion.valueclick.com
In article <3C1ECD6A.8090702@entermix.com>,
 mstearne@entermix.com (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';
   $itunes->play;

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                      pudge@pobox.com    http://pudge.net/
Open Source Development Network    pudge@osdn.com     http://osdn.com/

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About