Search code examples
macosapplescriptmacos-carbonappleevents

Tap AppleEvents being sent to another application


Is it possible to monitor or tap the stream of Apple Events being sent to a process, in the same way you can tap Quartz Events?

I have an application that talks to another application to force it to import files, but it does so in a way that's unavailable through menus or UI scripting, and I'm trying to track down how it does this.


Solution

  • Do you need to do this programmatically or is manual/interactive OK? If manual is OK, here are some approaches:

    Try using AppleScript Editor to record the target app.

    Try using the techniques listed in Technical Note TN2124: Mac OS X Debugging Magic under Apple Events. For example, set the environment variable AEDebugReceives to 1 and run the target app under that environment.