Hello, I'm new to KM.so Pardon my noobness. I've been using Autohotkey for windows. I wanted to have a similar function in KM and M1MacPro.
Basically what I want is a mouse get and mouse move action
Is it possible to add an apple script instead of using the Mouse move actions? That When I use the CONTROL Modifier and with the trigger, it gets the mouse coordinate and saves the x,y, in the action. And when pressed without the Control modifier mouse move at the saved x,y coordinate.
ie...press Control+F1 = saves the current mouse coordinate where the mouse pointer is
press F1 = moves the mouse to the x,y coordinate.
Yes, there is a Mouse Action but I don't want to setup manually. All I want is to use modifier +the trigger to get the Mouse x,y.
I will be grateful to those who can help me. Thank you.
To break down what is going on. In the first Macro, %CurrentMouse% is a Keyboard Maestro Token that will always be the coordinates of where the mouse currently is. Notice the greyed out numbers at the bottom of the first action - they show what the Variable SAVED__Mouse is currently storing and what it will store if you ran the Macro now. If you have the Macro open in the Editor and move the mouse around you will see the second set of numbers changing depending on where the mouse is.
So, 1753,932 is the current mouse x,y location.
And in the second Macro those coordinates (which were grabbed in a kind of snapshot when the first Macro was run and stored in the Variable) can be used to restore the mouse location.
ANd Is it possible to Put both Assign and restore mouse in One Macro? say Pressing a MIDI Key to Save coordinate and pressing another MIDI key to restore but put in a singe macro? Color.kmmacros (17.8 KB)
So you can use this information to set up a Macro that does two different things depending on what was actually pressed. Something like this, (where the Green Actions would be replaced by saving and restoring the mouse position).
Going forward, you can also directly see what values are held in %TriggerValue% by making a simple test Macro that displays them, something like the below (this would display the value ⌘A when triggered by pressing ⌘A)