Button condition not registering

I'm prompting the user with dialog buttons to decide what happens next in the macro. As you can see in the screenshot below, I've created the buttons "Rename" and "Continue". I then created an If All Conditions Met action with a Button condition.

When I click the "Rename" button, the If condition doesn't register as true as it should.

If I reverse the condition to "None of the following are true", the prescribed Then action will trigger.

I'm not sure what I'm doing wrong.

Screen Shot 2020-05-19 at 1.30.03 PM

Your If action is testing for the wrong thing. This is how it should be:

1 Like

That worked great! Thank you!

What is a good use case for the Button condition?

One would be to see if a button in a dialog you're automating actually is enabled or even exists. If the button is not enabled, then you'll need to take some action to enable it so it can be clicked. Also a button that's not enabled tells you about the current state of the app, e.g. in a text editor a save button might not be enabled if the text hasn't been changed.

In practice, I've never had to use the button condition so I'm sure there are lots of other use-cases!

1 Like

See: Button condition.

Note that you can hold the option key down when selecting from the (+) condition menu and it will offer help on the various conditions:

The same is true in most other menus in Keyboard Maestro (collections, triggers, also the token and function and action menus).


Thanks for pointing that out @peternlewis, I never knew KM offered that extra level of assistance. Amazing!

1 Like