I am having a problem with screen resolution which I was hoping to cure with a script.
I have a PowerMac connected to my TV through a VGA port. But when it powers up, the Mac insists on a resolution of 1280x960 which just leaves rubbish on the screen. I have to manually select 640x40 60hz and all is well. However, I do not want to have to do this every time I start the Mac up.
So, is there a script to set screen resolution which I could then incorporate as a login item? There was one thread pointing to “cscreen” which looked like the answer but the necessary links were dead:
there is an oem command line utility for changing all video prefs…
cscreen 1.4 Freeware 11/27/2004 unrated 3,363
command line app to switch screen resolution/depth
Any suggestions gratefully received.
Browser: Safari 419.3
Operating System: Mac OS X (10.4)
csscreen is a unix executable that you call like this:
set csScreen to "PosixPathTo_cscreen" -- I just put mine in my user's scripts folder.
do shell script csScreen
set screenResolution to the result
(* if screenResolution contains "1280" then
tell application "Stickies" to quit
(* because im tired of having
to organize all my stickies every time I switch*)
(*switch to dual [tv/mon] display*)
do shell script "cscreen -x 800 -y 600 -r 60"
else if screenResolution contains "800" then
(*switch to monitor display*)
do shell script "cscreen -x 1280 -y 960 -r 100"
csscreen is multi-monitor-aware; you can alter resolutions by device index id:
"6 displays found
Index Depth Width Height Refresh(Hz; LCD displays show 0)
1 32 1280 1024 85
2 32 1280 1024 85
3 16 1152 870 75
4 32 1152 870 75
5 32 1152 870 75
6 32 1280 1024 85
use -h to display all usage options"
"Usage: cscreen [-d <depth>] [-x <width>] [-y <height>] [-r <refresh>] [-s <display>] [-v] [-m] [-f] [-l] [-h]
[-d <depth>] : specifies the bit depth (bits per pixel)
[-x <width>] : specifies the width in pixels
[-y <height>] : specifies the height in pixels
[-r <refresh>] : specifies the refresh rate in Hz
[-s <display>] : specifies which display to use (defaults to main display)
use a as the option to -s to specify the action on all displays
[-v] : display valid modes (use -s to specify display or nothing for the default)
[-m] : require an exact match
[-f] : forces settings (ignores safety mechanisms; USE AT YOUR OWN RISK)
[-l] : lists the current displays and modes
[-p] : sets the requested display to be the primary display
[-h] : displays the usage"
If you can’t find a copy “out there”, send me an e-mail. It’s only 12k zipped.