a ui scripting menus

I’ve got this script for changing the colors of a display.
so far i have

tell application “System Preferences”
activate
end tell
tell application “System Events”
tell application process “System Preferences”
click button 9 of scroll area 1 of window 1(gets me into the displays pref pane)
click pop up button 1 of group 1 of tab group 1 of window 1 (clicks the colors menu button)
click menu item “Thousands” of menu “OtherViews” of pop up button 1 of pop up button 1 of group 1 of tab group 1 of window 1 (my attempt at selecting the item thousands from the menu, but it doesn’t work)
end tell
end tell

What am i doing wrong?

Hi,

Your comment in the script says that you are selecting the Color tab when you should be selecting the Display tab. Here’s what I got in Jaguar for my display:

tell application “System Preferences”
activate
set current pane to pane “com.apple.preference.displays”
end tell
tell application “System Events”
tell process “System Preferences”
tell window “Color LCD”
tell tab group 1
click radio button “Display”
tell group 1
click pop up button 1
tell pop up button 1
tell menu “OtherViews”
click menu item “Thousands”
–click menu item “Millions”
–every UI element
end tell
end tell
end tell
end tell
end tell
end tell
end tell

gl,

cheers, that works for me too, (on panther)