[LB6 Actions] Do not disturb/Toggle Notification Center

Sharing and discussing custom actions for LaunchBar
Post Reply
ptujec
Wizard
Wizard
Posts: 321
Joined: Fri Dec 19, 2008 11:36 am
Contact:

[LB6 Actions] Do not disturb/Toggle Notification Center

Post by ptujec » Wed May 28, 2014 12:39 pm

Image

Here is a simple action to toogle the "Do Not Disturb" switch in Notification Center.

Download "Toggle Notification Center" (for Yosemite)

This is the Applescript which is doing the magic:

Code: Select all

delay 0.2
try
tell application "System Events"
      tell process "SystemUIServer"
         key down option
         click menu bar item 1 of (menu bar 2)
         key up option
      end tell
   end tell
on error e
   display dialog e
   activate
end try


I found that piece in an Alfred workflow by @kudusch.

Update 1.1: Changed the icon to have a visual connection to what you see in the menubar

Update 1.2: This version is compatible with Mac OS 10.10 Yosemite.

If you still need the old version here is your download link.

Alberti82
Posts: 5
Joined: Thu Oct 23, 2014 4:33 pm

Re: [LB6 Actions] Do not disturb/Toggle Notification Center

Post by Alberti82 » Thu Oct 23, 2014 4:34 pm

Thank you very much! It works very well! Great job. :D

Post Reply