7

While it is possible to set a keyboard shortcut to bring up the Notification Center in Mac OS Yosemite, I cannot find a way to switch between the panels "Today" and "Notifications" via the keyboard - it only seems to be possible using the mouse/trackpad.

Is there anything I overlooked?

2

Applescript:

tell application "System Events" to tell process "SystemUIServer"
    click menu bar item "Notification Center" of menu bar 2
end tell

tell application "System Events" to tell process "NotificationCenter"
    click radio button "Today" of radio group 1 of window "NotificationTableWindow"
end tell

Depend on what an user needs, whether it's to switch when the menu is pulled out, or to simply access Today or Notifications on demand, one can modify the above code and bind it/them to keyboard shortcuts.

  • I am trying to modify the script so that I can directly open the desired panel of the Notification Center, but I cannot find any documentation on how to show/launch Not. Center via AppleScript. Would you know how to do that? Should I make this a separate question? – Bernd Oct 23 '14 at 6:35
  • Ok I realise that your first script aims at doing precisely this - it does not work for me, however, it says that "menu bar item "Notification Center" of menu bar 1 of process "SystemUIServer"" cannot be read – Bernd Oct 23 '14 at 6:43
  • Works for me. I think you need to understand that both snippets are actually 1 script. The first bit tells the notification centre to open, the second bit tells the notification centre to change to the today tab. (And if you try to run only the second bit of the code, it will not work as the NotificationTableWindow doesn't exist yet) – Skela Feb 23 '15 at 5:31
1

Just adding this based on fartheraway's answer (because he mentions how to get the Today tab to open).

Here's how to get it to open on the Notifications tab:

tell application "System Events" to tell process "SystemUIServer"
    click menu bar item "Notification Center" of menu bar 2
end tell

tell application "System Events"
    tell process "Notification Center"
        click radio button "Notifications" of radio group 1 of window "NotificationTableWindow"
    end tell
end tell

Now I just need to figure out how to run these off a keyboard shortcut :(

  • I haven't done it yet myself, but if Gruber is to be believed, Keyboard Maestro can not only simplify this in their editing environment, but would be an excellent way to configure a shortcut mechanism. I think BetterTouchTool may also have a method for doing so? – Jason Salaz Mar 4 at 5:15
0

As of Sierra, the menu bar layout has changed. The following should work:

tell application "System Events" to tell process "SystemUIServer"
    click menu bar item "Notification Center" of menu bar 1
end tell

tell application "System Events" to tell process "NotificationCenter"
    click radio button "Today" of radio group 1 of window "NotificationTableWindow"
end tell

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .