How to Explore System Preferences Displays panel?

Hi all,

I have recently downloaded Script Debugger for evaluation. I am very impressed so far, but will admit that I am quite the newbie as to how to make it do its magic. I’m hoping that some kind soul can give me some guidance on how to make the UI work.

I want to write a script to change the display resolution on my Mac. I became frustrated trying to divine the appropriate buttons to have AppleScript click. I have found the Explorer and have drilled down to the appropriate Displays Anchor, but can’t seem to locate the description of the items to then select the “Scaled” button, then one of the Resolution buttons.

I have looked through the Script Debugger help, and have seen where it talks about the Application Explorer. I think that is what I want in order to discover the appropriate buttons, but I don’t see them there:

Under anchor "displaysDisplayTab I would have expected for there to be additional buttons, tab groups, etc. How might I use the Explorer to determine what to tell AppleScript in order to do this?

Apologies, but the forum software allows me to only post one image, so here is the second one

1 Like

Although Script Debugger can show you much of the hierarchy, it doesn’t deal with all the accessibility features. For that, you need to look at something like UI Browser (, which is a specialist tool for just that thing.

Thank you @ShaneStanley for the suggestion. I am currently trialing UI Browser and it did indeed show me the way. For future travelers, here is the script that I ended up with for figuring out which resolution is currently active. Note that this is for a Mac with Retina display. YMMV if you don’t have a Retina display built-in.

--use AppleScript version "2.4" -- Yosemite (10.10) or later
--use scripting additions

set current_resolution_button to 0
tell application "System Preferences"
	set current pane to pane ""
	delay 0.3
	tell application "System Events"
		tell process "System Preferences"
			tell window "Built-in Retina Display"
				tell tab group 1
					click radio button "Display"
					tell radio group 1
						click radio button "Scaled"
					end tell
					tell radio group 1 of group 1
						repeat with button_number from 1 to 5
							if value of radio button button_number is true then
								set current_resolution_button to button_number
							end if
						end repeat
					end tell
				end tell
			end tell
		end tell
	end tell
end tell
display dialog "Resolution button is " & current_resolution_button