Because of a non-scriptable app, I will use UI scripting to control app. On a step of this, I must give a folder to save the output.
For simplicity, suppose the app to control is Preview.app, and the "Open..." navigation window is open (go to File > Open... of Preview.app).
I see this (it's on a French system):
I want to simulate the click on "Vidéo" on the sidebar of the window.
With: tell application "Preview" tell application "System Events" tell process "Preview" --click UI element 1 of row 2 of outline 1 of scroll area 1 of splitter group 1 of window 1 get name of UI element 1 of row 2 of outline 1 of scroll area 1 of splitter group 1 of window 1 end tell end tell end tell
I obtain: --> "Vidéos"
Good (row 2 is the second item of the side bar; for example, row 3 is the UI element "Application").
So, I test this: tell application "Preview" tell application "System Events" tell process "Preview" click UI element 1 of row 2 of outline 1 of scroll area 1 of splitter group 1 of window 1 --get name of UI element 1 of row 2 of outline 1 of scroll area 1 of splitter group 1 of window 1 end tell end tell end tell
Result: no error, but nothing changes.
I will obtain this ("Vidéos" selected):
How can I obtain this? Thanks.
|