I've recently released new version of some of my Mac:: modules. Highlights:
* Got rid of some pretty big memory leaks in Apple events
* Mac::Glue now defaults to using bundle ID, not app signature, for
targetting apps (falls back to app signature if no bundle ID)
* The glueedit script will now allow editing of glues. It dumps out the
glues as a big data structure, allows you to modify the dump, and then save
it back as a glue. Glues are based on dictionaries, which are not
necessarily representative of actual capabilities, so this is one way to
deal with that problem when it arises.
* Can create glues for apps that don't have an Apple event dictionary, such
as Preview, which allows you to use UI Scripting and standard events.
Here's an example of sending events sent to Preview where they work in a
limited fashion, and a workaround for when they don't.
my $preview = new Mac::Glue 'Preview';
$preview->activate; # works
$preview->obj(file => [EMAIL PROTECTED])->open; # also works
# $preview->obj(window => 1)->close; # unfortunately, doesn't work
# use UI scripting instead
my $events = new Mac::Glue 'System Events';
$events->obj(
menu_item => 'Close',
menu => 'File',
menu_bar_item => 'File',
menu_bar => 1,
process => 'Preview'
)->click;
(More on UI scripting at http://use.perl.org/~pudge/journal/18784)
--
Chris Nandor [EMAIL PROTECTED] http://pudge.net/
Open Source Development Network [EMAIL PROTECTED] http://osdn.com/