Re: UI Scripting Display's Resolution
Re: UI Scripting Display's Resolution
- Subject: Re: UI Scripting Display's Resolution
- From: Simon Dorfman <email@hidden>
- Date: Tue, 17 Feb 2004 22:48:55 -0600
Hi Aaron,
After quite a bit of tinkering I got this working. I had just figured out a
UI script of my own so it wasn't too bad.
Below is my script. You will have to modify it slightly because I'm sure
your video card and monitor are different than mine.
Here's what you need to do:
Download the shareware app: UI Browser from here:
http://www.prefab.com/uibrowser/
There is a free 30 day trial.
Use it to figure out the display menu. Look at the notes below at the top
of the script.
Hope this helps.
Simon
-----------------------------------------------
--script made with the help of program "UI Browser"
--If I ever need to edit this script, look at this code to figure out how to
change script.
--code from ui browser mouse over "Displays":
-- application "System Preferences"
-- window "System Preferences" (1)
-- scroll area 1
-- button "Displays" (8)
--code from ui browser menu button "Window->CPD-G220S":
-- application "System Preferences"
-- menu bar 1
-- menu title "Window" (5)
-- menu "Window" (1)
-- menu item "CPD-G220S" (5)
--code from ui browser mouse over "Display":
-- application "System Preferences"
-- window "CPD-G220S" (1)
-- tab group 1
-- radio button "Display" (1)
--code from ui browser mouse over "1280 x 1024":
-- application "System Preferences"
-- window "CPD-G220S" (1)
-- tab group 1
-- group 1
-- scroll area 1
-- table 1
-- row 9
-- text field 1
tell application "System Preferences"
activate
end tell
tell application "System Events"
tell process "System Preferences"
tell scroll area 1 of window "System Preferences"
click button "Displays"
end tell
tell menu "Window" of menu bar 1
click menu item "CPD-G220S"
end tell
tell tab group 1 of window "CPD-G220S"
click radio button 1
select row 9 of table 1 of scroll area 1 of group 1
end tell
end tell
keystroke "q" using {command down} --quits system preferences
end tell
-----------------------------------------------
On 2/17/04 4:33 PM, "Aaron Valenta" <email@hidden> wrote:
>
Trying to create an applescript that changes the monitor's resolution to
>
1280x1024 but it's buried in so many UI elements that can't quite get it
>
right. Here's what I have:
>
>
tell application "System Preferences"
>
activate
>
end tell
>
tell application "System Events"
>
tell process "System Preferences"
>
click menu item "Displays" of men "View" of menu bar 1
>
delay 3
>
select text field "1280 x 1024" of column 1 of table 1 of scroll area 1 of
>
group 1 of tab group 1
>
delay 1
>
end tell
>
end tell
>
>
but no matter how I try to reword the actual selection of the 1280 x 1024 I
>
keep getting "NSReceiverEvaluationScriptError: 4" so I realize my path to the
>
text field isn't liked but don't know the proper command. Any help greatly
>
appreciated.
>
>
Aaron
>
_______________________________________________
>
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.