Re: Window watcher
Re: Window watcher
- Subject: Re: Window watcher
- From: Bill Cheeseman <email@hidden>
- Date: Mon, 1 Nov 2010 12:27:41 -0400
On Nov 1, 2010, at 11:23 AM, Michael Wood wrote:
> Is there a way to watch a particular application for dialog boxes and
> when one pops up, do something (e.g. click on the OK button)?
By itself, AppleScript (even with GUI Scripting) does not automatically notify you or respond when a window is created or any other event happens. A few scriptable applications implement this sort of thing, but most do not. The Standard Additions scripting addition responds to certain events (Folder Actions), but not the sort you want.
But my UI Actions product does exactly what you want. Read about it and download a non-crippled 30-day free trial version at <http://pfiddlesoft.com/uiactions>. You use the UI Actions Setup application to "register" to observe notifications broadcast by any target application via the accessibility mechanism built into Mac OS X, and to "attach" any AppleScript script to that notification so that the script is triggered and runs whenever the notification is received. Filters are available to limit the notifications to particular windows (by title, for example), and you can always write the script to do additional filtering. The system implements 30 or 40 kinds of notifications; one of them, AXWindowCreated, notifies you every time a window (such as a dialog) is opened.
You write the triggered script to do anything you like. If it is addressed to a scriptable application, it can tell the application to do anything in its terminology dictionary. It can also use GUI Scripting techniques to do things like click specified buttons even in a non-scriptable application.
--
Bill Cheeseman - email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden