Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 3.2

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): 24,669
Starting Page Number: 13
Article Number: 3209
Related Web Link(s):

http://software.oxalyn.com/AEMonitor/

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.

I was shocked to discover that no such utility existed for OS X. The best suggestion from Apple was to use the Terminal to set up Apple Event debugging, but the debugging output is voluminous, difficult to locate, and hard to understand. This was the seed of the idea for AE Monitor: an obvious, empty place in the programmer's toolbox. I set about filling it.

Scratching

...End of Excerpt. Please purchase the magazine to read the full article.