I’m trying to use GUI Scripting to press a button that functions as a ‘Save As’ button in a shareware app’s UI.
Apple’s UI Element Inspector sees the path as:
<AXApplication: “Web Snapper”>
<AXWindow: “Web Snapper”>
<AXButton: “download”>
PreFab Software’s UI Browser sees the path as:
PATH TO ELEMENT:
application “Web Snapper”
standard window “Web Snapper”
scroll area (scroll area 1)
table (table 1)
[MISMATCH] button “download” (button -2147483648)
the code generated by UI Browser (as well as my own hand written code) won’t click that ‘download’ button. I am able to UI Script the clicking of other buttons in this UI. 'UI Browser’s" help has a blurb about MISMATCH being caused by the element hierarchy being different based on whether you’re look up at the element from the root application element or down on the element from the mouse perspective. these 2 hierarchies are supposed to be the same.
when i do a command-F10 in Apple’s UI Inspector, i CAN trigger the button click via the Inspector’s Action window (by pressing the ‘Perform’ button). (is it possible the Apple is using something other than the scriptable UI components to make this happen?)
Here’s the code that doesn’t work. The runtime error highlights the ‘click button’ line and says “System Events got an error: NSReceiverEvaluationScriptError: 4” Any suggestions?
tell application "Web Snapper"
activate
end tell
tell application "System Events"
tell process "Web Snapper"
tell window "Web Snapper"
tell scroll area 1
tell table 1
--tell row 1
click button "download"
--end tell
end tell
end tell
end tell
end tell
end tell
end