in working through Apple’s UI scripting environment using UI Browser and UI Element inspector, I’m slooowly figuring out how the syntax works… or so I think. I’m working on trying to select a particular option in a pop up button in the Finder’s ‘Find’ window. I can get the window to come up, and select the ‘contains’ pop up button but I can’t for the life of me select any of the other items in the pop up menu–such as ‘starts with’. Here is the script I have so far;
tell application “Finder”
tell application “System Events”
pick menu item “Find…” of menu “File” of menu bar item “File” of menu bar 1 of application process “Finder”
click pop up button 1 of UI element 1 of group 1 of UI element 6 of window “Find” of application process “Finder”
UI scripting is pretty cool… when you get results. But I’ve found that the UI scripting dictionary is so overwhelming (or try Word 2004!) at times and the actual examples rather thin. Also, UI scripting in other applications seems a rather spotty affair as your not sure if you can or can’t script a particular interface element of the target application.
The fun never stops.