vitor Posted October 30, 2017 Share Posted October 30, 2017 (edited) Usage Toggle your Focus Mode via the dnd keyword. Optionally give a number when enabling to activate it for that amount of minutes, or hours if an h is appended. ⤓ Install on the Alfred Gallery | Source Edited March 25, 2023 by vitor paulw, godbout, piggah and 4 others 7 Link to comment
Christophe 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 comment
vitor 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 comment
Christophe 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 comment
vitor 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 comment
Christophe Posted February 26, 2018 Share Posted February 26, 2018 Thanks for all the explanations Vitor :-) Link to comment
akishaha Posted September 16, 2018 Share Posted September 16, 2018 Its not working on High Sierra. ☹️ Can anyone help me ? Link to comment
vitor 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 comment
evanfuchs 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 comment
CJK 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 comment
vitor 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 comment
JMichaelTX 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 comment
vitor 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 comment
mlondon 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 comment
vitor 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 comment
vitor 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 comment
vitor Posted January 22, 2021 Author Share Posted January 22, 2021 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 comment
vitor Posted November 27, 2021 Author Share Posted November 27, 2021 (edited) Updated for Monterey and removed support for older macOS versions. Also, added support choosing a length of time for Do Not Disturb to be active! It now uses a macOS Shortcut to do its task. Hopefully that means Apple won’t keep forcing us to come up with new solutions. The Shortcut is included, and you’re propped to install it on first activation: 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 on Big Sur and version 21.7 of this Workflow, the update won’t trigger until you update. The version you have should keep working. Edited November 27, 2021 by vitor paulw and alfredpanda 2 Link to comment
alfredpanda Posted December 1, 2021 Share Posted December 1, 2021 Works perfectly in Monterey, thanks so much Vitor! It's so helpful to use this throughout the day. 🙌 Is the green icon a baby's bottle? That's one thing that confused me 😂 Link to comment
vitor Posted December 1, 2021 Author Share Posted December 1, 2021 1 hour ago, alfredpanda said: Works perfectly in Monterey, thanks so much Vitor! Great! Glad to read that. Hopefully by using a Shortcut it means imApple won’t break the functionality in a future macOS version. 1 hour ago, alfredpanda said: Is the green icon a baby's bottle? Yes. Baby bottle to calm down, battery to energise. alfredpanda 1 Link to comment
alfredpanda Posted December 10, 2021 Share Posted December 10, 2021 One more thing I love about this is how my iPhone will sync the DND status. I'm now using this multiple times a day. Thanks Vitor! vitor 1 Link to comment
dd852 Posted December 29, 2021 Share Posted December 29, 2021 Huge thank you - this is such a useful thing to have. Link to comment
Grug Posted January 29, 2022 Share Posted January 29, 2022 On Macos BigSur, it open Skype 🤔 I think it's the shortcut (the app doesn't exist on Big sur) Link to comment
vitor Posted January 29, 2022 Author Share Posted January 29, 2022 Just now, Grug said: On Macos BigSur, it open Skype Shortcuts doesn’t exist on Big Sur. No idea why Skype wants to handle that file extension on your machine, but that’s not something I have control over. This older version of the Workflow works on Big Sur. Grug 1 Link to comment
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