After years of tried and true operation of this Macro working properly on the 2019 Intel Mac Pro running Catalina, I'm experiencing an anomaly on a new M2 Mac Pro Tower running Sonoma.
If I turn off "Restore Mouse Location" on the step where the macro moves and clicks the mouse, this macro will click in the proper location as expected. However, when "Restore Mouse Location" is enabled for this step, the mouse pointer will move to the correct location, but will not click. It's as if the Restore Mouse Location function precedes the click, when it's really expected to click first, then restore the previous mouse location. Please see the attached macro. Thanks!
When this happens to me, I usually solve it by splitting the mouse action into multiple actions (eg, Move Mouse, Pause, Click Mouse, Pause, Restore Mouse position to some saved variable that contains the position of the mouse before you moved it.) This always solves the problem for me. You are probably getting the problem because your new Mac is faster and your new OS with its new GUI has different timing characteristics.
There are some KM internal variables that might also be able to solve this, but I try to avoid that because they affect all macros, and it's better just to address the macro with the problem.
Hey - Thanks for the reply. I was trying to do that, but couldn't figure out how to store a mouse position, enact a bunch of steps, then come back to that saved mouse position... I'd love some help on how to do that
Also - I discovered another piece of the puzzle: My macro works 100% reliably as long as the window I'm clicking on, inputing text, etc. is on the Main screen. So I have a screen to my left, center, and right, as well as a TV as a fourth screen... but there are major inconsistencies if I'm affecting a window on any other screen than the Center (Main) screen.
It sounds like you successfully diagnosed one issue, which is what are the conditions required to make your Click action fail. Off the top of my head, I'm not sure why that causes the action to fail. Well, let's consider that issue after I've shown you how to split your action into multiple actions. Here is your action: (I have removed the "Restore" flag checkmark from the cogwheel.)
Let's break that up into separate actions, which hopefully will fix your issue. This approach has always fixed my problems, but I can't 100% guarantee it will fix yours. These sorts of things can be dependent upon screen setups, the specific apps involved, internal KM settings, and maybe OS or KM versions. But here's the code I would use to replace your suspect action:
Notice above how I save the mouse location in a variable called LocalMouseLocation, then move the mouse to your preferred location without doing a click, then pause briefly, then click at the current mouse location, then pause again briefly, then set the mouse location to where it was earlier. I don't have your app (Cubase), so I can't test this code, but some apps do some weird things with input buffers, which means introducing pauses like I have done above can fix the issue.