Skip to content

Instantly share code, notes, and snippets.

@erica
Created August 13, 2018 14:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erica/5b444e720ff1516e03302e303b1c78bd to your computer and use it in GitHub Desktop.
Save erica/5b444e720ff1516e03302e303b1c78bd to your computer and use it in GitHub Desktop.
if ! [[ $(plutil -convert xml1 -o - ~/Library/Preferences/ByHost/com.apple.notificationcenterui.*.plist | grep false) ]]; then
osascript <<EOD
tell application "System Events" to tell process "SystemUIServer"
key down option
click menu bar item 1 of menu bar 1
key up option
end tell
EOD
fi
if [[ $(plutil -convert xml1 -o - ~/Library/Preferences/ByHost/com.apple.notificationcenterui.*.plist | grep false) ]]; then
osascript <<EOD
tell application "System Events" to tell process "SystemUIServer"
key down option
click menu bar item 1 of menu bar 1
key up option
end tell
EOD
fi
@jsit
Copy link

jsit commented Dec 11, 2018

Does this work for you in Mojave? I can't get it to option-click the Notification Center icon; it just registers as a standard click.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment