Move mouse to alert window

If the primary window is an alert box, I’d like the location of the default button so I can move the mouse over the button. (The default button is the one that is “clicked” when the return key is typed.


Hey @grig,

That’s not so easy to do reliably.

Keyboard Maestro only sees a certain number of window types.

To get really reliable results you’d have to depend upon UI-Scripting with System Events.

Run this from the Script to get an inkling of how this works:

tell application "System Events"
   tell (first process whose frontmost is true)
      tell front window
         UI elements
      end tell
   end tell
end tell

Also — see my macros in this thread:

Window Information Tool


Thanks Chris!