How do I program a mouse click on a floating window?

I am relatively new to KM and use it to select menu items in the music program Finale. It works perfectly for that use. I also want to use it to execute a mouse click on a particular icon on a floating window. I have found an action titled "move and click" but I don't understand how to find the x, y coordinates on the floating window or in general how to program KM to do this. Can anyone help?

Move or Click Mouse action is the right tool for this job. The trick is specifying where to click. I see at least a few options:

  1. If the window is the front most window at the time, then use "relative to front window", and enter the offset from one of the corners of the window.
  2. ELSE if the window has a unique name, first make it be front most using the Manipulate a Window action to bring a named window to the front. Then do Step 1 above.
  3. ELSE if the target icon is unique and clear, use the "relative to found image" option, and select "center of the image" and then 0 for the offset coordinates.

I have successfully use all of these options for different use cases. You should be able to make one of them work.
If you need more help, please post a screen shot of the window of interest, and identify the target icon.

Please read:
Tip: How Do I Get The Best Answer in the Shortest Time?

Hi JMichaelTX and thank you for your help! I was able to program the mouse click on the window! However the Manipulate a Window action is not working. Would you mind taking a look at the screenshot and telling me why you think it's not working? If you have any suggestions I'd greatly appreciate it!!

Finale "rewind" macro screenshot

As I said above:

Thnx again! The target icon is the "rewind to beginning" button. It's the one directly under the word "time". But as I said, that aspect of the macro is working. What's not working is the 1st action which is bringing the "playback controls" window to Front. Here's the screenshot:
playback controls screenshot

thanks for the screenshot.

What that means is that KM can't "see" the "Playback Controls" window, since it apparently is a non-standard window. So, you will need to find some other means of bringing it to the front.

Might there be a menu item fin Finale that will show or activate the Playback window? Maybe the View, or Tools, or Window menus?

For that matter, is there a menu item that will do the "rewind", same as the button?

JMichaelTX,

Thnx again for your response!

No there is no other menu item in Finale that will show or activate the playback window nor is there a menu item that will execute rewind.

So yes I do understand that I need some way of bringing the playback controls window to the front. But other than clicking on it with the mouse I know of no other way. The problem is, because it’s a floating window, automating a click to bring it to the front won’t work.

Might you have any other ideas of how to bring the window to the front?

Thank you.

Looks like this will work for Move and Click relative to Found Image:
image

Give that try. Copy the image on your screen using the macOS screenshot tool.

JMichaelTX,

Thank you again. Yes that works. Well almost. It brings the window to the front and that’s proven when I execute because the image highlights in green. However, the mouse click is not executing. I’m sure it’s because the x, y coordinates aren’t correct. How do I find the proper coordinates?

Use the macOS screenshot tool for a region, and click on one corner of the area you are using, and drag to the center to the button you want to click on. Keep holding the mouse button down, and note the X,Y distance. I usually use the left,top corner.

See Use macOS screenshot tool as a screen ruler

JMichaelTV:

Yes! It works! Thank you!

1 Like