OS X:监视应用程序中的对话框创建
是否可以让 OS X(Leopard 或更高版本)通知您对话框创建?
我希望能够监视特定应用程序创建的对话框,然后根据显示的对话框执行某些操作。 “做某事”可能会涉及 Applescript GUI 脚本来单击按钮等。
我被告知 Applescript 不提供用于窗口创建的通知/事件。 Objective-C 或其他东西可以实现这一点吗?
谢谢。
Is it possible to get OS X (Leopard or later) to notify you of dialog box creation?
I want to be able to watch for dialog boxes being created by a particular app and then do something depending on the dialog box that is displayed. The "do something" will likely involve Applescript GUI scripting to click on buttons etc.
I have been told that Applescript does not provide notifications/events for window creation. Is this possible with Objective-C or something else?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
可以使用 辅助功能 API做这种事。有很多 API,文档可能有点令人畏惧,因此第三方开发人员有一个名为 PFEventTaps 据称简化了“辅助应用程序”的编写。
玩得开心!
The Accessibility APIs can be used to do this sort of thing. There are a lot of APIs and the documentation can be a bit daunting, so a third-party developer has a framework called PFEventTaps that purportedly simplifies writing "assistive applications".
Have fun!
不可能让 applescript 事件侦听器“侦听”对话框。但我已经为 indesign 或 quark 编写了 applescript,它们使用超时检查对话框是否存在,并尝试使用语句来执行我希望对话框执行的操作。但我会在脚本中预期出现对话框的区域中放入代码来执行此操作
Its not possible to have applescript event listeners to "listen" for a dialog. But I have written applescripts for indesign or quark that check for the existance of a dialog using a timeout and try statments to do what I want the dialog to do. But I would put code in to do that in areas of my script where I would anticipate the presence of a dialog