0

I'd like to preface that I am very new to Applescript and UI scripting. I am working inside a proprietary CMS and wish to build a script to open a file search box, paste in the filename, select it, and click Finish. I have been successful scripting the UI hierarchy, but have noticed that if I scroll around the page then the Group number changes which breaks my script.

For example, this snip of script works, but if I scroll around the page then the Group number changes from 47 to 48. The entire script is performing several copy/paste functions and this Group change sometimes occurs mid-run, so I can't "set it and forget it".

tell application "System Events
perform action "AXShowMenu" of text field 1 of group 1 of group 1 of group 1 of group 47 of UI element 1 of scroll area 1 of group 1 of group 1 of tab group 1 of splitter group 1 of window "Strapi - Content Manager" of application process "Safari" end tell

I'd like to target this text field via an UI attribute (and hopefully ignore Group number or possibly condense the UI string), but am not sure exactly what to use. Several fields such as Title and Description are blank. I am including a screenshot of UI Browser for this element. I'm also open to incorporating JavaScript but have zero knowledge so there'd be an obvious learning curve there. I appreciate any and all help!

enter image description here

  • You can’t ignore or skip parts of the UI hierarchy for any given element (named or not) - that is how it is targeted. You might have better luck checking out the page document object model to see the layout and if a particular element can be directly accessed. – red_menace Oct 04 '22 at 23:45

0 Answers0