Stories
Slash Boxes
Comments
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)

pudge
  (email not shown publicly)
http://pudge.net/
AOL IM: Crimethnk (Add Buddy, Send Message)

I run this joint, see?

Journal of pudge (1)

Tuesday December 10, 2002
03:13 PM

More on Mac::AppleEvents, Mac::OSA

[ #9364 ]

I was having problems with AEDescs because I was putting data into Handle using strlen() to get the size. strlen() just figures out the length of a C string, up to the first null. I wanted to use the length from AEGetDescDataSize() or GetPtrSize(). But I didn't.

Mac::OSA::Simple works pretty well, though I need to release a new version to support Mac OS X. I can do stuff like:

use Mac::OSA::Simple;
my $play  = compile_applescript('tell app "iTunes" to play');
my $pause = compile_applescript('tell app "iTunes" to pause');
 
sub play  { $play->execute  }
sub pause { $pause->execute }

Calling play() and pause() are much much faster than calling DoAppleScript($script) over and over again, because the compilation phase of the AppleScript is time-consuming. This kind of thing should work fine now, but return values are broken (the way AEPrint() returns data has changed, and I was using that instead of $desc->get), as is saving a script to disk (e.g., $pause->save($filename); my $script = load_osa_script($filename, 1);; this is related to the problem of my current FSSpec routines requiring files to exist, which needs to be fixed).

So I won't be releasing the new Mac::OSA::Simple too soon; I want to first see about addressing my issues with the FSSpec routines, and I need to revamp how I release modules (bug reporting, CVS, releases on CPAN and SourceForge.net, etc.).

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.