vitor 897 Posted October 30, 2017 Share Posted October 30, 2017 (edited) Call dnd to toggle Do Not Disturb. Download | Source If on a macOS version pre-Big Sur, download an older version. Edited January 22 by vitor piggah, nikivi, andmetoo and 1 other 4 Link to post
Christophe 0 Posted February 24, 2018 Share Posted February 24, 2018 Hello! Complete newbie here, running Alfred 3.6 on Mac OS 10.9.5 Nothing happens when typing in dnd (I have allowed Alfred to control my computer in the privacy settings). Could you please advise? Thanks! Link to post
vitor 897 Posted February 25, 2018 Author Share Posted February 25, 2018 Welcome @Christophe, Unfortunately, your macOS version is too far behind for me to be able to help. The solution needed to toggle Do Not Disturb is already somewhat hacky, and as far as I can tell earlier versions of macOS required different methods. Link to post
Christophe 0 Posted February 25, 2018 Share Posted February 25, 2018 Thanks Vitor for your response. I suspected that the OS might be the problem. Your workflows that only work within Alfred (eg Ping Pong or FormatSize) work well, but any other that trigger something outside (like dnd, TemplatesManager, TemporaryEmail) don't do anything. Maybe one day I'll upgrade my OS (or learn to code!) Link to post
vitor 897 Posted February 25, 2018 Author Share Posted February 25, 2018 3 hours ago, Christophe said: any other that trigger something outside (like dnd, TemplatesManager, TemporaryEmail) don't do anything. TemplatesManager is expected not to work, as it uses JavaScript for Automation (JXA) and that was only introduced in Yosemite (10.10). As for TemporaryEmail, it uses regular AppleScript, so it should work, unless something has changed since Mavericks. Workflows of mine that should work for you are the ones that don’t interact with a GUI, as for that one needs AppleScript/JXA. So macOS-specific apps/features (Finder, Notification Center) and browser interactions are out. Some of the older ones might still work, like IncognitoClone. But you should really update your OS. By staying so far behind you’re exposing yourself to some potentially nasty bugs. Link to post
Christophe 0 Posted February 26, 2018 Share Posted February 26, 2018 Thanks for all the explanations Vitor :-) Link to post
akishaha 0 Posted September 16, 2018 Share Posted September 16, 2018 Its not working on High Sierra. ☹️ Can anyone help me ? Link to post
vitor 897 Posted September 16, 2018 Author Share Posted September 16, 2018 5 hours ago, akishaha said: Its not working on High Sierra. ☹️ Can anyone help me ? Welcome @akishaha, Please don’t post “it’s not working” messages, as that doesn’t help us help you. How is it not working? What were the exact steps you took? What happened (or didn’t)?. What was the out put of the debugger with the log output set to “All Information”? Here’s how to post an effective bug report: Link to post
evanfuchs 4 Posted September 16, 2018 Share Posted September 16, 2018 Minor issue: Toggling dnd off ("turn it off") works, but the Notification Center icon remains dimmed as though Do Not Disturb is still on. I'm using High Sierra 10.13.6 Do Not Disturb on Do Not Disturb off If I toggle Do Not Disturb off manually, it reverts to the darker icon as a visual cue. If I toggle using the workflow it remains faded. Link to post
CJK 27 Posted September 16, 2018 Share Posted September 16, 2018 On 2/25/2018 at 12:45 AM, vitor said: The solution needed to toggle Do Not Disturb is already somewhat hacky Saw this remark from a while ago, and things may have changed. What method do you use to adjust this setting ? Link to post
vitor 897 Posted September 16, 2018 Author Share Posted September 16, 2018 7 hours ago, evanfuchs said: Minor issue: Toggling dnd off ("turn it off") works, but the Notification Center icon remains dimmed as though Do Not Disturb is still on. That may not be something fixable, due to the nature of the hackiness required. 7 hours ago, evanfuchs said: I'm using High Sierra 10.13.6 I’m on Sierra, but I will update to Mojave. If I look at this, it will be then. 2 hours ago, CJK said: Saw this remark from a while ago, and things may have changed. Unlikely. Apple is making automation harder, not easier. 2 hours ago, CJK said: What method do you use to adjust this setting ? The defaults method. It’s easier if you open the Workflow and see for yourself; it’s straightforwards Bash, and just a few lines. Link to post
JMichaelTX 0 Posted October 27, 2018 Share Posted October 27, 2018 On 9/16/2018 at 6:14 PM, vitor said: The defaults method. It’s easier if you open the Workflow and see for yourself; it’s straightforwards Bash, and just a few lines. Thanks for sharing. I need to implement this in AppleScript. I don't have Alfred, but I downloaded your Workflow, but don't see the Bash. Would you mind posting the Bash here, or providing a direct link to it? Thanks. Link to post
vitor 897 Posted October 28, 2018 Author Share Posted October 28, 2018 6 hours ago, JMichaelTX said: Would you mind posting the Bash here action="${1}" if [[ "${action}" == 'on' ]]; then defaults -currentHost write "${HOME}/Library/Preferences/ByHost/com.apple.notificationcenterui" doNotDisturb -boolean true defaults -currentHost write "${HOME}/Library/Preferences/ByHost/com.apple.notificationcenterui" doNotDisturbDate -date "$(date -u +'%Y-%m-%d %H:%M:%S +0000')" killall NotificationCenter else defaults -currentHost write "${HOME}/Library/Preferences/ByHost/com.apple.notificationcenterui" doNotDisturb -boolean false killall NotificationCenter fi Link to post
mlondon 0 Posted December 30, 2018 Share Posted December 30, 2018 Hi Victor, Thanks for the worklfow, but I am having the same issue (in macOS 10.13.6) that when I turn DND off, the Notification icon in menu bar does NOT turn from Grey back to Black. Please advise. Thanks, Matthew Link to post
vitor 897 Posted December 30, 2018 Author Share Posted December 30, 2018 13 hours ago, mlondon said: Thanks for the worklfow, but I am having the same issue (in macOS 10.13.6) that when I turn DND off, the Notification icon in menu bar does NOT turn from Grey back to Black. The old post still applies: Link to post
vitor 897 Posted August 4, 2019 Author Share Posted August 4, 2019 Update. Added External Trigger. To update, download the latest version (same URL) or wait a few days and it’ll prompt you to on next usage, since it uses OneUpdater. Link to post
vitor 897 Posted January 22 Author Share Posted January 22 Updated for Big Sur and removed support for older macOS versions. To update, download the latest version (same URL) or wait a few days and it’ll prompt you to on next usage, since it uses OneUpdater. If you’re still on pre-Big Sur, download an older version of the Workflow and delete the node labeled OneUpdater. Link to post
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now