Re: Menulet scripting
Re: Menulet scripting
- Subject: Re: Menulet scripting
- From: "-dan d." <email@hidden>
- Date: Tue, 27 Jun 2017 09:42:33 -0400 (EDT)
Sounds like a good place to use cliclick.
On Tue, 27 Jun 2017, Bob Stern wrote:
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
[ Part 1.2.1, Text/HTML (charset: UTF-8 "Internet-standard Unicode") ]
[ ~68 lines. ]
[ Unable to print this part. ]
[ Part 1.2.2, Image/PNG (Name: "Screen Shot 2017-06-27 at 4.20.34 ]
[ AM.png") 12 KB. ]
[ Unable to print this part. ]
[ Part 2: "Attached Text" ]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
XB
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden