Possible to restore mouse location *after* additional clicks and typing?

Let me start by saying that I'm already familiar with the "Restore Mouse Location" option under the gear menu of a Click action. But this is a bit different:

After using a Click action, I have subsequent actions that type some necessary keystrokes within a window. Then, after the final keystroke (typing the Enter key), that's when I need the cursor returned to the original location. But the keystroke actions apparently negate the earlier "Restore Mouse Location" option.

Is there a way to restore the original cursor location after those subsequent actions?

Hi @soundsgood,

It's totally possible.
This is how you can do:


Same solution just a little bit simpler...Always one more way to do the same thing.

Restore mouse postion.kmmacros (2.6 KB)


Fantastic! Thanks to both of you!

I enjoy the challenge of finding new ways to do things. So I came up with a different solution. Here's how I can do it now:


In order for this to work, today I created a KM macro called "Stack [Push/Pop] [Mouse/Variable]". What this does is let you save either a specified variable (it works only if the variable isn't a multi-line string) or "Mouse" and then restore it later as I show in the example above. Of course you would need to see my macro to be able to use this idea (just ask if you want to see it.) This may be too complex a solution for you. But it's a working solution that might appeal to some people.