Move mouse with a set Y-axis

I want to make a macro where I have a set Y-axis so that when I click the macro the mouse will move from current mouse location straight up or down to the Y-axis without changing the X-axis.

Does anyone have any suggestions to how I can make a macro who does exactly that?

The 'move mouse' action does exactly that. You need to change a few of the default options. See screenshot.

But that would only move it -54 from where the mouse is when you click the macro. What I want is a set Y-axis where the X- is relative. So say the mouse is at -100, -100 or 100, 100, and I've set my Y-axis to be 0, when I press the macro it will go to -100, 0 or 100, 0.

I might be unclear. But what I want is basically a move mouse function where Y is an absolute position, but the X is current position. It might not be possible.

I see now. There are others that know a lot more than me, but I don't think KM can do that natively. From looking around it appears Applescript might be able to help you.
There are also two command line apps that look like they will do what you want (possibly in conjunction with Applescript):

https://www.bluem.net/en/projects/cliclick/

Cliclick can be installed via homebrew.

And:

http://www.hamsoftengineering.com/codeSharing/MouseTools/MouseTools.html

Keyboard Maestro 8.2.4 “z TBD Set x,y of mouse” Macro

z TBD Set x-y of mouse.kmmacros (1.6 KB)

2 Likes

I'm not an expert by any stretch.
Thought I would put these two macros up for you.
First set the X and Y for the mouse with the first macro.
Then when you run the second macro the mouse will move to the pre-defined X and the current mouse Y.

Keyboard Maestro 8.2.4 “z TBD Move mouse to stored x and mouse current y” Macro

z TBD Move mouse to stored x and mouse current y.kmmacros (2.3 KB)

3 Likes

Thanks, I have to check that out.

Thanks Troy, That looks promising. I will try this out and I hope that it will work for my use.

1 Like

Thanks Troy!
You solved the problem I was looking the solution for!!!!!

1 Like