点击 AppleEvents 被发送到另一个应用程序

问题描述:

是否可以像点击 Quartz 事件一样监控或点击发送到进程的 Apple 事件流?

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?

我有一个应用程序可以与另一个应用程序通信以强制它导入文件,但它以一种无法通过菜单或 UI 脚本实现的方式执行此操作,我正在尝试追踪它是如何执行此操作的.

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.

您需要以编程方式执行此操作还是手动/交互式可以?如果手动没问题,这里有一些方法:

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

尝试使用 AppleScript 编辑器录制目标应用.

Try using AppleScript Editor to record the target app.

尝试使用 技术说明 TN2124:Mac OS X 中列出的技术"nofollow">Apple 活动.例如,将环境变量 AEDebugReceives 设置为 1 并在该环境下运行目标应用程序.

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.