Blumentopfgewinner Posted March 23, 2014 Posted March 23, 2014 Hello there! Here's a simple workflow to toggle "Do Not Disturb". I got the underlaying script from this blog. Enjoy. Download
loris Posted March 24, 2014 Posted March 24, 2014 Useful, thank you! Would be even better if it could indicate the current state of the "Do no disturb" toggle (either in the Alfred menu or in a notification)
Blumentopfgewinner Posted March 25, 2014 Author Posted March 25, 2014 You can see it in the menu bar. When Do Not Disturb is activated, the Notification Center icon becomes grey. (You can btw. also ⌥-Click on the icon to activate Do Not Disturb!)
Subject22 Posted July 26, 2014 Posted July 26, 2014 (edited) This is broken in the Yosemite public beta (probably do to some menu bar reorganisation?) Anyway, I tinkered a bit but couldn't fix it. The best I came up with was this Applescript: tell application "System Events" tell process "SystemUIServer" try key down option click menu bar item 1 of menu bar 2 key up option on error key up option end try end tell end tell Note the use of the try block. In the current version of the workflow the option key gets stuck pressed down, preventing you from typing normal characters until you restart System Events (or reboot your Mac). I can see the script above clicking the Notification Centre icon, because the icon flashes blue when I run it. It doesn't actually toggle Do Not Disturb though. Edited July 26, 2014 by Subject22 alanmoo 1
Ender Posted December 6, 2014 Posted December 6, 2014 I had the same problem. I got it to work using the "Run Script" action (and selecting /usr/bin/osascript as the language) rather than using "Run NSApplescript".
Subject22 Posted December 9, 2014 Posted December 9, 2014 Would you mind uploading the workflow that's working for you? Cheers
liatmgat Posted May 26, 2016 Posted May 26, 2016 Hi all, I downloaded Ender's updated workflow last year - thank you so much! However, it doesn't seem to work when I have my computer set in another language. Is there any way to fix this? Thanks, Liat
paulw Posted May 26, 2016 Posted May 26, 2016 Hi all, I downloaded Ender's updated workflow last year - thank you so much! However, it doesn't seem to work when I have my computer set in another language. Is there any way to fix this? Thanks, Liat You might try the workflow I added to Ender's thread. I *think* it might work with other languages. http://www.alfredforum.com/topic/5266-toggle-do-not-disturb-w-yosemite-support/?p=44414
Jkscx Posted October 25, 2017 Posted October 25, 2017 (edited) None of the previous solutions worked for me so I tried to craft something myself and it worked! Running it successfully on El Capitan 10.11.6 with Bartender 2. I got the code from this StackOverflow answer and converted into a simple Alfred workflow. Should also work on any Mac (with or without Bartender) as long as Apple doesn't change the Notification Center plist location (I think...). https://drive.google.com/file/d/0Bx3NCikqzbt5Qm1TdmkwQWFxUkU/view?usp=sharing Edited October 25, 2017 by Jkscx Beter formating
paulminors Posted September 25, 2018 Posted September 25, 2018 On 10/26/2017 at 9:01 AM, Jkscx said: None of the previous solutions worked for me so I tried to craft something myself and it worked! Running it successfully on El Capitan 10.11.6 with Bartender 2. I got the code from this StackOverflow answer and converted into a simple Alfred workflow. Should also work on any Mac (with or without Bartender) as long as Apple doesn't change the Notification Center plist location (I think...). https://drive.google.com/file/d/0Bx3NCikqzbt5Qm1TdmkwQWFxUkU/view?usp=sharing 1 Hi, I tried this workflow and couldn't get it to work on MacOS Mojave. Any ideas? alfredpleb 1
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