I have a macro that, when triggered, records the coordinates of the Next & Previous Preset buttons on a VST’s window into a json file. I simply hover the mouse over the desired button and then trigger the macro. The coordinates I store are relative to the Top-Left corner of the VST window using the following calculation:
Due to my aging eyes, I often use the Ctrl + two-finger scroll gesture to zoom in on the display. Using the above calculation, the value of “RelativeMouseCoords” is the same regardless of zoom level. You can test this yourself by using KM’s Mouse Display (Cmd-5). Keep the mouse pointer at the same location, and change the display zoom and you will notice that the coordinates do not change.
Later, I use another macro that retrieves the coordinates from the json file and uses that to click the VST’s button. This has worked perfectly for years as long as the display’s zoom is at 100%.
But, if I have the display zoomed-in to say 137%, I can’t seem to get back to the same location. I’m using the following calculation to put the mouse at the correct coordinates:
So, in summary, getting the mouse pointer’s coordinates works regardless of zoom level, but setting the coordinates does not. Any suggestions on how to fix this?




