When I start the macro, it detects that DND is not active. But if I start the macro again nothing happens.
Only when I start the macro again, DND is deactivated.
Hey @appleianer I think the problem is you are using "matches" instead of "contains". Normally "matches" is used for regex matching, but it would also work fine with 0 or 1 like you have been using it - IF that variable ONLY contains 0 or 1. If you check my original post you'll see it's set up to use "contains" because the result of the original command was a string like " doNotDisturb = 0;"
But, before you change it, you can actually change the command to the one below, then "matches" should work just as well. Or you can change it to "is".
I just updated the command to remove the need for grep, not sure if it will help you though. The command is just:
My Enable/Disable Macros are here.. Note that you need to change the Simulate Keystroke hotkey to match the key you've set in System Prefs. DND.kmmacros (5.6 KB)
Thanks @jon123 for your answer and the modified macro.
I have installed your macro and unfortunately still had the error that the "then - action" could only be started when activating it for the second time.
The error was not in your macro but in the Focus app. I was able to fix this in the meantime, so that your macro, with my additions, now runs perfectly.
Just updated to Catalina (fresh install though)... I'm actually having an issue with the hotkey on Catalina now. I've set the hotkey in System Prefs, but when I try to run the macro to execute the keystroke it doesn't work (error sound plays). Typing the shortcut myself works fine.
Yep. Just double checked, KM and KM Engine are both enabled for Accessibility.
KM enabled for "Full Disk Access".
Automation shows a few apps under KM, all enabled.
Tried turning them both off/back on in Accessibility, no still not working though.
I tend to agree, but if I press the shortcut with the keyboard it works fine - DND mode is enabled/disabled when I press it. Only get the alert sound when KM issues the keystroke.
I just tried changing the shortcut in system prefs, and making the same change in KM, still getting the error sound when trying to run it.