Thanks Bill, David and Naganoya-san. (Bill: I'm running El Capitan.)
The menulet is displayed by an otherwise faceless background application whose function is to control configuration parameters of an audio output hardware device (D/A converter). The application communicates with the hardware device through a kernel extension installed along with the faceless application.
The menu extra has 5 menu items. The first 2 menu items have sub-menus:
I cannot access any of the menu items by index number because AppleScript reports the menu extra as having only one menu bar item:
tell application "System Events" tell menu bar 1 of process "exaSoundDashboard" count menu bar items -- returns count = 1. end tell end tell
Curiously, a tell directed to menu bar 2 produces the error "Can’t get menu bar 2 ..." Contrary to OS X menu extras, this application's menu extra is menu bar 1.
If I replace the count command with "click menu bar item 1", the menu does drop down. However, I cannot click any of the menu items. I get an error that menu bar item 2 or 3 does not exist when I do the following, with or without the preceding line commented out:
tell application "System Events" tell menu bar 1 of process "exaSoundDashboard" -- click menu bar item 1 click menu bar item 2 -- Error if number is 2, 3, etc. end tell end tell
Clicking by position does nothing:
tell application "System Events" tell menu bar 1 of process "exaSoundDashboard" click menu bar item 1 -- menu drops down. click at {859, 80} -- no menu item is clicked. end tell end tell
Same result:
tell application "System Events" tell menu bar item 1 of menu bar 1 of process "exaSoundDashboard" click at {859, 80} -- menu drops down but no menu item is clicked. end tell end tell
If there's no solution, I can try begging the manufacturer to add keyboard shortcuts, a window interface that can be scripted, or a CLI. :)
Bob Stern |