问题
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.
回答1:
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.
回答2:
there is no such tap for ae events AFAIK I am happy to be proven wrong
there are NSDistributed notifications which you can tap!
来源:https://stackoverflow.com/questions/15422004/tap-appleevents-being-sent-to-another-application