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 March 12, 2002
12:19 AM

Mac::Glues on Mac OS X

[ #3454 ]
I did some investigation tonight on how to make glues for Mac::Glue from Mac OS X apps. Some observations:
  • We sometimes get the AppleScript terminology data in the aete resource from the files themselves. However, there is no one standard in the apps themselves. iTunes.app has a iTunes.rsrc resource fork file which I could open with MacPerl to create the glue; Internet Explorer.app had a similar file, but it was not a resource fork file, it was a plain data file. And Cocoa apps like Mail.app don't have such a file with aete resource at all.
  • I suspect that, unlike Mac OS, Mac OS X won't have applications that won't respond to the "ascr\gdte" Apple event, which returns the aete data. In other words, maybe we won't have to parse any file data, and just get it via an event (which is what happens for most apps even under Mac OS 9).
  • The observations about being able to get aete data via Apple events doesn't directly apply to Scripting Additions and the "dialect" file. Standard Additions.osax is like Internet Explorer.app ... I need to figure out how to get the data from these things, since we always just opened the resource fork, and that may no longer be feasible. OTOH, maybe it will be. Or maybe I can somehow get the data via some Apple event.
  • So to get the data, I think can just drop a package on the droplet, find $package/Contents/PkgInfo, open it up, get the application's signature ("emal" for Mail.app), and then use that to get the aete data. It worked just fine this way for Mail.app, and I created a usable glue and everything:

      use Mac::Glue;
      my $mail = new Mac::Glue 'Mail';
      $mail->activate;
      $mail->mailto('mailto:pudge@pobox.com');

    Yes, this is MacPerl running under Classic talking to a Cocoa app running under Mac OS X via Apple events with Mac::Glue. And it works with very little modification of Mac::AETE::App and Mac::AETE::Format::Glue.

  • Not all the problems are so easily solved, of course. There's the Scripting Additions problem mentioned above; there's also potential problems with launching apps, especially by path instead of signature, etc. All will need to be tested and played with in due time.
  • Of course, none of this is entirely useful right now, unless you want to use MacPerl on Mac OS X. The real purpose of this is to know what to do when we can use Mac::Glue under native perl on Mac OS X.
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.
  • Cocoa's got some base AppleScript functionality built into it, and as far as I can tell, pretty much any Cocoa app will do basic AppleScript for free.
    • Yeah, that's all fine; the point here is not whether it can do it, or how it does it, but how I can get the AppleScript terminology information from it. Apparently for Cocoa apps, I have all the work done. But for other Cocoa things, like Cocoa-based Scripting Additions, I am not sure yet; I did look at some of Apple's Cocoa docs, and didn't see much. I am sure there's more there; that part's down lower on my list anyway, though.

      If you do come across docs that discuss where on the filesystem the AppleSc