Check Pixel Condition Relative To Front Window

In an If Then Else Action, Pixel Condition, I'd like it to check for pixels at X, Y coordinates relative to the front window's top left corner(and all other relative options). At this point it checks for Pixels based on the X, Y coordinates relative to the Main Window. I know it's possible to move and click a mouse relative to a front window, but that choice doesn't seem to be available for the Pixel Condition. This would be very useful in situations where I need to automate check boxes and menu selections on a window that may change in size, but the check box and pull down menus stay in a consistent position relative to the window.

Hope this makes sense. Let me know if there's a better way to determine if a box is checked or not.


Use the WINDOW function, like WINDOW(1,Left)+50,WINDOW(1,Top)+100.

1 Like

Hey Kevin,

Run this macro when that window is frontmost in your app. (It may take a little while to run, since there are many elements in the window.)

Front Window Analysis Tool for System Events

TextEdit will open with a bunch of fairly indecipherable text, but what we’re looking for is items that start with this text:

«class chbx»

If System Events can see them then there are probably ways to manipulate them directly.


Or use UI Browser:, which has quickly become indispensable to me.

If you need help with it, just ask. This tool is awesome for finding things like this.

Thanks Peter!

This looks interesting. I’ll check it out.

Thank you Chris. I’ll try this method as well.


Once you get the info, you use it in AppleScript, something like this:

tell application "System Events" to tell process "Keyboard Maestro" to get exists text field 1 of sheet 1 of window "Keyboard Maestro Editor"

For this particular script, I use it to wait for Keyboard Maestro’s “Save As” dialog to open.

Dan, when you get a chance, could you please post the macro where you use this?
I don’t understand why a normal KM Pause Until Window Title = “Save As” wouldn’t work?

Well, see, it’s like this here…

  1. I didn’t realize it had a title. I didn’t even know until a couple of days ago what you called those kinds of dialogs. “Sheets”, right? Since I didn’t see a title anywhere, it never dawned on me there was one.

  2. I have issues where an external drive will sometimes need to wake up, so timing can be an issue.

  3. Also, and probably the actual reason I chose this code, is that I use it elsewhere to make sure the “Go to folder” action is done going to the folder I told it to (don’t like depending on “Pause” an arbitrary amount of time), so I just grabbed that code and use it here.

Or something like that.