Click Without Losing Control of Mouse

Hello, I am making all my macro clicks in a single application. I would like to be able to do other stuff while the macro runs in the background on a single PC.

Is it possible to create clicks in Keyboard Maestro without giving up control of your mouse?

There’s an old scripting app called Simba that had this feature I'm unsure if KM has it also.

Nyet.

But – you may (or may not) be able to drive UI elements using AppleScript UI-Scripting and run that from an Execute an AppleScript action.

That would be interesting actually. I’m not too familiar with apple scripts. The current script I need running in the bg is heavily reliant on KM’s click on found image feature so I have a feeling it’s out of reach.

One other thought I had was setting up KM in a virtual machine but I am unsure how mouse control works or which VMs would be compatible.

You can't find images on screen, unless they're visible in the foreground.

I have no experience doing that and can't be of help...

By foreground you mean the application must be on the top i.e focused? I also ran into something called multi seating, but there isn’t much support available for MacOS yet unfortunately

By default, the Click at Found Image action searches "All screens", and as such the app need only to be visible onscreen for an image to be found. If the action is set to search the front window, the app will obviously need to be focused.

You may also find, if the app is not already in focus, that clicking once at the image will bring the app to the front rather than click the desired element, much the same as clicking manually would do. Therefore it's a good idea to bring the app to the front, click the element, and then return the previous app to the front.

Like @ccstone mentioned you should look into AppleScript. It may seem intimidating at first but it opens up a lot of possibilities that can really streamline your macros.

Also, if you provide some more details, such as what application you are clicking in, and/or posting your macro itself, we could likely provide some more specific advice.

All my macros have been set to search in the Application, only when the Application is focused to retain consistency in case I'm watching videos or something with similar pixels. Perhaps I should to switch to a location-based click so that I don't have to worry too much about mis-clicking a similar pixel.

I am using Maestro to automate clicks in a video game application while I do other things. It's clicking on certain objects in the game, and moving my character from point a to point b using "found image" pixel commands.

Gotcha, since it's a video game I highly doubt it's scriptable with AppleScript. Likely the found image solution would still be best.

2 Likes

Agreed. If you capture and return the current mouse position, you'll barely notice the click happened.

1 Like