Force KM to always reference Top Right Corner of Application

Hi Guys,

I'm a recent KM adopter and love it!!

One thing that's frustrating, however, is that I use KM inside an application whose window is resizable but the graphics are always top-right justified. So, for this app, I'd like to have all mouse actions refer to the Top Right of the Apps window as apposed to the default which is Top Left. I manually have to adjust it so it looks like this:

Is there a way to record macros where I can ask KM to always reference Top Right?



Andrew K

No, there is no way to set the default recording to be “top right”.

However, when recording, Keyboard Maestro records both the click and the window and screen information, and so you can change the click reference location in the recorded action and Keyboard Maestro will adjust the coordinates to match. This information is not saved permanently, so you need to make the adjustment fairly promptly (quitting the editor, or a macro sync from another Mac would lose the information).

Thanks peternlewis!!

Yes… I did notice the mouse’s relative offsets were stored for a while… but it’s good to know that it’s safe so long as I don’t switch macros or quit the Editor.

Would it be possible to create a KM Macro to “look for” or change “Top Leftf” in a KM sequence and alter it to Top Right… or would that cause a space-time paradox resulting in the End Of Times? :smile:


Andrew K

You could use the token %WindowSize%1% to get the dimensions of the front window.
From here you could dynamically calculate the coordinates from top left of the window.

Thanks Jimmy.

I’ll try to wrap my head around what your are saying when I wake up in the morning. Looking at what you wrote, I’m not sure I’m fully understanding you.

That said, I’m getting quicker at manually converting “top left” to “top right”.

Cheers… AK


I have made an example.

I need to click “Indbakke” in the 2 images below. It is always placed in the same coordinate from the top right corner.

This macros below solves the problem. Hopes this makes sense.


Hi JimmyHartington,

Wow… thanks for that!!! I’ll will absolutely try this. Seems like a great little trick to include at the top of my Macros for that particular app.

I’m busy mixing right now (I’m a software dev. for music), but will check this out when I get a chance.

Thanks again for you help!!


Andrew K