I’m new to Applescript. I hope the following makes sense.
I have a MacPro running 10.5 “Leopard” connected to a TV. I’ve created two scripts, one to switch “Mirror Displays” on and change the resolution to 1024x768 (for the TV), and the other to switch “Mirror Displays” off and change the resolution to 1920x1200. I downloaded and am using cscreen (the version from Oct. 24, 2008) for the res changes. Changing to 1920x1200 works fine, as does the Mirror Displays change, but changing to 1024x768 does not work - it instead drops to 800x600. I tested the command in Terminal and it returns “Using closest match” and still changes the res to 800x600 instead of 1024x768. I’ve also tried adding/changing the -d, -s, and -r parameters without success. Manually changing the res works fine.
Is there a way to fix this? Is there an alternative to using cscreen (I noticed it’s no longer available)?
Thanks much!
Here is the code:
-- Switch on mirrored displays
tell application "System Preferences" to reveal anchor "displaysArrangementTab" of pane id "com.apple.preference.displays"
tell application "System Events" to tell process "System Preferences"
if value of checkbox 1 of group 1 of tab group 1 of front window is 0 then
perform action "AXPress" of checkbox 1 of group 1 of tab group 1 of front window
end if
end tell
-- Change resolution for television use
do shell script "cscreen -x 1024 -y 768"
-- Quit
tell application "System Preferences" to quit
Model: Mac Pro
AppleScript: 2.0.1
Browser: Firefox 3.0.1
Operating System: Mac OS X (10.5)