I have an app (xBack) that is only accessible via a menu that lives in the right half of the menu bar, along with various “SystemUIServer” menus, like the Keyboard Layout menu.
However it does not have the attribute “AXDescription” that is called with the (incredible!) script work provided at page:
http://bbs.macscripter.net/viewtopic.php?id=18620 (thank you, Yvan and Kai!!)
The Accessibility Inspector reveals the following for the “Stop” menu item:
----
<AXApplication: “xBack”>
<AXButton: “”>
<AXMenuItem: “Stop”>
Attributes:
AXRole: “AXMenuItem”
AXRoleDescription: “menu item”
AXParent: “”
AXEnabled: “true”
AXPosition: “x=985 y=45”
AXSize: “w=242 h=19”
AXTitle: “Stop”
AXHelp: “(null)”
AXSelected (W): “true”
AXMenuItemCmdChar: “(null)”
AXMenuItemCmdVirtualKey: “(null)”
AXMenuItemCmdGlyph: “(null)”
AXMenuItemCmdModifiers: “0”
AXMenuItemMarkChar: "
AXMenuItemPrimaryUIElement: “(null)”
Actions:
AXCancel - cancel
AXPress - press
----
and the following is for the “Start” menu item:
----
<AXApplication: “xBack”>
<AXButton: “”>
<AXMenuItem: “Start”>
Attributes:
AXRole: “AXMenuItem”
AXRoleDescription: “menu item”
AXParent: “”
AXEnabled: “true”
AXPosition: “x=985 y=26”
AXSize: “w=242 h=19”
AXTitle: “Start”
AXHelp: “(null)”
AXSelected (W): “true”
AXMenuItemCmdChar: “(null)”
AXMenuItemCmdVirtualKey: “(null)”
AXMenuItemCmdGlyph: “(null)”
AXMenuItemCmdModifiers: “0”
AXMenuItemMarkChar: "
AXMenuItemPrimaryUIElement: “(null)”
Actions:
AXCancel - cancel
AXPress - press
----
I need a script to be able to select one or the other of these two menu items (which also, as you can see, are not in the same place in the menu items list). The xBack menu item moves around in the menu bar, depending on the apps that are running, so I can’t just issue mouse clicks according to a set of screen coordinates and I haven’t been able to figure out how to utilize the AXApplication and the AXMenuItem properties or the AXTitle attribute.
Thoughts?
Thanks!!
P.S. Also, the script attached to the link in posted scripts:
“Open this Scriplet in your Editor:”
used to work, but now strips out all the line breaks. Is that because I am still running 10.4.11? Thanks!
Model: MBP C2D
AppleScript: 1.10.7
Browser: Firefox 3.0.3
Operating System: Mac OS X (10.4)