Applescript - a script to change display / screen resolution on startup

I have a new MacPro desktop with a 20" ViewSonic Optiquest widescreen monitor. Every time the computer restarts, it resets the display settings and has to manually be reset back to 1680 x 1050. I've tried all the tips and tricks I could find to get it to stop doing that (deleting preferences and zapping PRAM, etc) and none of them worked. So now I'm thinking I could work around it by creating a script that will reset the display resolution at startup. Only, I'm feeling like I need a translator to understand half the incomprehensible things people are posting online about AppleScript and GUI scripting. I'm not an expert with this and I don't want to be. It makes my head hurt.

Simply put...

1. Is it possible to script changes to the Displays preferences pane in OS 10.4.11? Yes or no?
2. If yes, can I use Script Editor to do it, or do I need another script writer?
3. If I do need another script writer, which one and where do I get it?

Here's what I've written so far. It opens the Displays preference pane, but I can't get it to set the resolutions value to 1680 x 1050:


tell application "System Preferences"
activate
set the current pane to pane id "com.apple.preference.displays"
set "AXValue (W)" to "1600 x 1200"
end tell


I used UI Element Inspector to get the following info on that preference pane, which is where I got the "AXValue (W)" from:

-----------------------------

Attributes:
AXRole: “AXTextField”
AXRoleDescription: “text field”
AXHelp: “(null)”
AXValue (W): “1680 x 1050”
AXEnabled: “1”
AXFocused: “0”
AXParent: “<AXRow>”
AXWindow: “<AXWindow: “AL2223W”>”
AXTopLevelUIElement: “<AXWindow: “AL2223W”>”
AXPosition: “x=974 y=616”
AXSize: “w=179 h=17”
AXChildren: “<array of size 0>”
AXSelectedText: “(null)”
AXSelectedTextRange: “(null)”
AXNumberOfCharacters: “11”
AXVisibleCharacterRange: “pos=0 len=11”
AXInsertionPointLineNumber: “(null)”

Actions:
AXShowMenu - show menu
AXConfirm - confirm

-----------------------------

Any suggestions? I need to rest my brain now.

Message was edited by: Ray Lopez

Mac Pro 4 core Intel Zeon, Mac OS X (10.4.11)

Posted on Jul 8, 2008 10:51 AM

Reply
1 reply

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Applescript - a script to change display / screen resolution on startup

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.