I have never before had such a clear idea for a piece of software I would write if I was a programmer, because apparently no one’s written this one yet. I want an easier way to control Do No Disturb on my Mac, with several preferences and maybe even scriptability. In fact, essentially I want Caffeine or Amphetamine (which control Sleep) for Do Not Disturb.
Here’s my problem: I want to be able to automatically activate Do Not Disturb when certain apps are launched (e.g. Audio Hijack, Skype, Zoom, etc.) and then have it turn off when I quit the app. Yes, I know I can manually activate DND, but then I have to remember to turn it off. The schedule in System Prefs is no good because it’s only to turn it on and off at the same time every day!
As far as I’ve been able to discover, there are no AppleScript or Automator hooks for DND. I did find an old
defaults write terminal command (like several versions of macOS ago), but while it seems to indicate that it’s on, I’m still getting notifications and the UI isn’t saying DND is on.
defaults write ~/Library/Preferences/ByHost/com.apple.notificationcenterui.*.plist doNotDisturb -boolean true (where * equals the unique alphanumeric on this machine’s plist)
When I run the command and I do a
defaults read, I get the response that it’s on, but it doesn’t act like it.
So does anyone have any ideas where I go from here?