Press Button Action Freezes

I am creating a macro to Uninstall some software. Everything works up until the macro selects the "Uninstall" button.

What is happening... it actually does execute the Press Button action (uninstall button) because the dialog box comes up asking for permission to remove the application - however the macro just freezes at this point. Any more actions after this will not perform until I hit "cancel" and then I get an error: Press Button "Uninstall" Failed to find button.

Error log:

_    2019-04-12 09:55:18 Execute macro “Activate a Specific Application” from trigger Editor_
_    2019-04-12 09:55:26 Assertion Failed: err == 0 ,  file: /Users/peter/Keyboard Maestro/Project/Source/Actions/, value: -25204_
_    2019-04-12 09:55:29 Press Button “Uninstall” failed to find button._
_    2019-04-12 09:55:29 Press Button “Uninstall” failed to find button. Macro “Activate a Specific Application” cancelled (while executing Press Button “Uninstall”)._

It almost acts like a debug stop. Any ideas why it just freezes at this point? Also, note in error log.. it has /User/Peter . This is not my directory-is this an issue and how do I adjust this?

Hey Brian,

Keyboard Maestro can't find the button, and by default the action aborts the macro:


Please post an image, so we can see what you're talking about.

That's a notation for Peter that has nothing to do with your system.

It's understandable that it's confusing though – I asked him about that many years ago.


Thanks for the help CC,
It DOES see it because it performs the ACTION (presses the "uninstall" button and opens up the dialog to approve). It just stops AFTER the execution. I can not execute any other action after this. Then when I cancel, it give the error that it can not find it even though it just executed it. :frowning:

The accessibility command for pressing the button is synchronous, so it does not complete until the targeting application finishes the action, which in this case includes putting up the dialog and getting some sort of answer.

The error returned is kAXErrorCannotComplete

This is either because you clicked Cancel, or because the application took so long to respond, either way the system reported that pressing the button failed, and Keyboard Maestro is reporting that.

This is just an indication of where in the source code the assertion happened, not a reference to a file on your Mac.

It is changed for the next version.

An alternative to the Press Button would be a Click Mouse at Found Image action, which would be asyncronous - the click would be simulated and then Keyboard Maestro would continue on.

1 Like

That will work. Thanks Peter!

Ah, so you said in the OP. My mistake.

An alternative to Peter's suggestion of using a Click at Found Image action is to use a submacro and turn on the “Asynchronously” option.



I don't know that this will actually help in this case - the synchronous accessibility API will actually lock the Keyboard Maestro Engine up entirely while it waits for the action to be performed.