KM not pausing the correct time

I created a macro to activate "Do Not Disturb" mode with 5 options (5/15/30/45 minutes or Cancel). No matter what I press, the macro only pauses for 5 minutes. For example, if I want the macro to activate for 45 minutes, I would select "45 minutes", but unfortunately it seems like the macro ends after 5 minutes instead of 45 minutes. Please advise, thanks.


Do Not Disturb Timer Part 1 imgur link
Do Not Disturb Timer Part 2 imgur link

Do Not Disturb Macro.kmmacros (24.6 KB)

Here's a hint. "45" contains "5" (and so does "15" for that matter). You may want unique options, which you can set apart from the button text (see the Help for the User Input action in the Gear menu of the action for details). Or you can start with 45 and end up with 5 so if 45 and 15 fail, 5 will succeed.


Thank you so much. Seriously.

My pleasure!

Another solution to simplify the macro would be to extract the digit from the selection and pass that to the pause action.

1 Like

Use the “is” condition test instead of “contains”.

See the Variable condition.

You could also use a Switch or Case action.

But extracting the time from the result as @JimmyHartington suggested would be the best solution, and allow you to change the buttons at will.