Re: Need help scripting System Prefs (Displays)
Re: Need help scripting System Prefs (Displays)
- Subject: Re: Need help scripting System Prefs (Displays)
- From: Jamie Eastwood <email@hidden>
- Date: Thu, 13 Mar 2003 11:45:39 +0000
Hi Jonathan,
Try this for starters.
tell application "System Events"
activate
end tell
tell application "System Preferences"
activate
end tell
tell application "System Events"
tell process "System Preferences"
click menu item "Displays" of menu "View" of menu bar 1
end tell
end tell
tell application "System Events"
tell process "System Preferences"
tell window "iMac"
tell application "System Events"
click radio button "Display" of tab group 1 of window "iMac" of
process "System Preferences"
end tell
end tell
tell window "iMac"
tell application "System Events"
select row 2 of table 1 of scroll area 1 of group 1 of tab group 1
of window "iMac" of application process "System Preferences"
end tell
end tell
end tell
end tell
This script works for me, though you may need to change the name of the
window 'iMac' in 'System Preferences:Displays' to whatever your window
is called. Also depending on the resolutions that your display supports
you may be able to display a dialog and ask for 'default answer' and
then perform 'if statements' such as:
if result of default answer = 640 x 480 then
tell window "iMac"
tell application "System Events"
select row 2 of table 1 of scroll area 1 of group 1 of tab group 1
of window "iMac" of application process "System Preferences"
end tell
end tell
else
Cheers,
Jamie
On Tuesday, March 11, 2003, at 04:41 pm, Jonathan M. Rubin wrote:
>
I am trying to write 2 different scripts to change the Sound Output
>
and the
>
Display Resolution.
>
>
>
I have used the UI Inspector to just about figure them out, but I'm
>
stuck on
>
one thing--how do I select an item in a text filed? UI Inspector says
>
that
>
the list of Resolutions as well as Sound Output choices are text
>
fields. How
>
do I script selecting the choice I want?
>
_______________________________________________
>
applescript-users mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.