I'm trying to interact with a print dialog via Applescript.
What I want to emulate is the user setting a value on a specific dropdown.
Say I have:
tell application "System Events"
tell process "Preview"
set value of pop up button XXX to YYY
end tell
end tell
How should I know the name XXX? For example, how would I distinguish between the "printer" and "presets" dropdowns?
I've opened the Accessibility Inspector, but from the information displayed there, I cannot spot a reference to the name or some other unique identifier for the specified dropdown.
I've seen many people using numbers to refer to the different dropdown, but I'm not sure this is good practice. What happens if Apple decide to swap the order of two dropdowns at some point?
Any help would be appreciated.
UPDATE:
Using 10.6.8 and inspector as suggested below, I get the following:
UI elements
command from here helpful as well: n8henrie.com/2013/03/a-strategy-for-ui-scripting-in-applescript