Adjust Resolution

Hi I create a script to adjust resolution.
That just can open system preferences but can’t enter display to adjust resolution automatically.
I’m so confuse what’s wrong with this script
Thank in advance…


tell application "System Preferences"
	activate
end tell
delay 4
tell application "System Events"
	tell process "System Preferences"
		click menu item "Displays" of menu "View" of menu bar 1
		delay 4
		click radio button "Display" of tab group 1 of window "Color LCD"
		delay 4
		select row 1 of table 1 of scroll area 1 of group 1 of tab group 1 of window "Color LCD"
		delay 4
		--1st change system resolution.
		
		select row 2 of table 1 of scroll area 1 of group 1 of tab group 1 of window "Color LCD"
		delay 5
		--2nd change system resolution.
		
		select row 3 of table 1 of scroll area 1 of group 1 of tab group 1 of window "Color LCD"
		delay 5
		--3rd change system resolution.
		
	end tell
end tell

Model: MacBook (White)
Browser: Safari 525.28.3
Operating System: Mac OS X (10.5)

Hi,

you can open the Displays Preference Pane and select the Display tab easily with


tell application "System Preferences"
	activate
	reveal anchor "displaysDisplayTab" of pane id "com.apple.preference.displays"
end tell

There is a command line interface to change screen resolution, GUI scripting is not needed
cscreen