Re: Window watcher
Re: Window watcher
- Subject: Re: Window watcher
- From: "Stockly, Ed" <email@hidden>
- Date: Mon, 1 Nov 2010 15:05:56 -0500
- Acceptlanguage: en-US
- Thread-topic: Window watcher
On 11/1/10 9:00 AM, "Michael Wood" <email@hidden> wrote:
>> This can be done using system events and GUI scripting for most applications.
>
> Thanks for the answer. The GUI scripting is not the problem. Where
> do I find out about using system events to watch for some sort of
> "dialog box has popped up" event?
GUI Scripting is part of the solution to the problem...
Here's a handler I use that clears most of the OSX error dialogs that appear
when a particular script is run.
The script calls this handler when the idle handler is invoked, about once a
minute.
That said, I plan to investigate the solution Bill suggested. It sounds like
it may resolve an number of issues.
ES
on ClearRandomErrors()
try
with timeout of 10 seconds
tell application "System Events"
activate application process "UserNotificationCenter"
try
click button "Close" of window 1 of application process
"UserNotificationCenter"
end try
try
click button "Ignore" of window 1 of application process
"UserNotificationCenter"
end try
try
click button "Cancel" of window 1 of application process
"UserNotificationCenter"
end try
end tell
end timeout
end try
end ClearRandomErrors
_______________________________________________
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