I am trying to get the keyboard to focus the right menu bar (Bartender 3 has this exact same feature). In System Preference, Shortcut, Keyboard there is a shortcut but it works only for the left menu.
I've tried some AppleScript but I am total noob.
tell application "System Events" to tell process "SystemUIServer"
tell (activate menu bar 2)
end tell
end tell
this is with a shortcut from bartender 3. Basically get the focus on the first menu (on the menu bar on the top right) so I can move with the keyboard.
![bartender 3 shortcut example1]](../../images/cc8d75002512f31ad174d58b485ff421.webp)
It could work if I click the menu with the mouse (so scripting applescript to click) but I believe that I need to know the position of the last menu or the name. Since those menu dont really have an order they might change (they are created with Hammerspoon so I might delete them, change them etc.)
Sure I could just click the menu that is always there and move from there but I would like to know how to recreate Bartender 3 shortcut.
activatecommand only acts on applications, not processes and you cannot activate a menu by sayingactivate menu bar 2. – user3439894 Jan 02 '20 at 02:37menu bar 1, and notmenu bar 2, even though its on the right-hand-side.menu bar 2is where icons belonging to user-installed applications exist, such as Dropbox, or Bartender 3's icon, even though they appear to share the same physical space as the system icons frommenu bar 1. – CJK Jan 06 '20 at 07:10SystemUIServerto click so I gave it a try. – Virgil Sisoe Jan 14 '20 at 17:41