I’m hoping someone can help. I’m trying to perform a scripted UI task on an app that has no dictionary and that has very little in the way of UI properties. The app has an issue with the click command so I’m having to use cli’s cliclick. I can navigate to the button in the main window with
the last button of UI element 1 of UI element 1 of group 4 of list 1 of group 2 of window tracks_window whose accessibility description = "send button"
— I’m storing the button into a variable, setting it’s position to a variable then running cliclick using the x, y variable, see below
tell application "System Events" to tell process "the app"
set tracks_window to title of first window whose title contains "- Tracks"
set frontmost to true
set theImage to the last button of UI element 1 of UI element 1 of group 4 of list 1 of group 2 of window tracks_window whose accessibility description = "send button"
set {x, y} to position of theImage
do shell script "/usr/local/Cellar/cliclick/5.1/bin/cliclick rc:" & x + 10 & "," & y + 7
key code 11
key code 124
…
— Key code 11
— Key code 124
— … Navigates to what’s labelled as
menu item 1 of menu 1 of menu item "Bus" of menu 1 of UI element 1 of group 4 of list 1 of group 2 of window tracks_window
(My UI properties script couldn’t identify it I got that result using Automator)
— When clicking on menu item 1 in Automator, Automator returned the text content of the menu item. I don’t know if it’s a value, description, name, accessibility description or whatever but “System Events” doesn’t seem to think it exists.
— Any of these menu items that are already assigned contain “→” in the menu item text.
— I want to focus the menu and do some thing like:
set theBus to the last menu item of menu 1 of menu item "Bus" of menu 1 of UI element 1 of group 4 of list 1 of group 2 of window tracks_window whose value does not contain "→"
— As I’m having an issue with the second UI path is there anyway to search the active/frontmost menu and look for the last item that does not contain “→”? Something like:
set theMenu to frontmost is focused of menu
set theItem to the last menu item of theMenu whose accessibility description does not contain "→"
set {x, y} to position of theItem
do shell script "/usr/local/Cellar/cliclick/5.1/bin/cliclick rc:" & x + 10 & "," & y + 7
Or a repeat loop that says something like if highlighted text of selection contains “ →” then key code 125 else key code 36 end if
Thanks in advance