Article Preview
Buy Now
| Print: | |
| PDF: |
Feature
Scratching the Itch
The life and times of an OS X utility
Issue: 3.2 (November/December 2004)
Author: Eric M. Williams
Author Bio: This month's Postmortem brings us the story of AE Monitor, a Mac OS X utility to capture, analyze, and recreate Apple Events. The story begins with the motivations behind creating AE Monitor, the implementation and testing phase, and the "post-birth" lifecycle of the product through its current version. Finally, the future of AE Monitor will be considered. Eric M. Williams is a Macintosh consultant and shareware author living in Seattle, Washington, U.S.
Article Description: No description available.
Article Length (in bytes): 22,266
Starting Page Number: 13
RBD Number: 3209
Resource File(s): None
Related Link(s): None
Known Limitations: None
Excerpt of article text...
The Itch
I don't remember the exact moment I needed a utility like AE Monitor, but I can guess it went something like this: I was trying to control some other application from REALbasic, probably the Finder or QuarkXPress. Although you can accomplish this task by integrating AppleScripts into your RB project, this is often unwieldy due to the challenges raised by passing arguments to the scripts, which only accept text parameters. Plus, they can be difficult to debug; you can't step through AppleScript code and figure out where something is going wrong.
Fortunately, REALbasic offers an alternative in the form of its built-in support for sending and receiving Apple Events. This support, while not a 100% complete representation of the Apple Event API, provides enough functionality for most developers. It can be difficult to use though, due to the complex nature of Apple Events and having to dig through an application's AppleScript dictionary to find the correct codes to use.
In the old days of Mac OS 9, a control panel named CaptureAE did this job by capturing Apple Events as they passed through the Apple Event Manager and displaying their data in a window. Developers could copy and paste this information and use it to construct Apple Events. Alas, CaptureAE did not make the leap to Mac OS X and only works in the Classic environment, and cannot detect Apple Events exchanged between OS X applications.
...End of Excerpt. Please purchase the magazine to read the full article.
Article copyrighted by REALbasic Developer magazine. All rights reserved.
|










