• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RE: setting up resoloution
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: setting up resoloution


  • Subject: RE: setting up resoloution
  • From: Marc Glasgow <email@hidden>
  • Date: Sat, 5 Feb 2005 16:22:42 -0500

It took me quite a while to find a solution for my monitors as well. Here's the solution:
Find a copy of CSCREEN at http://www.pyehouse.com/lynn/cscreen.php, a free application for setting resolution at the kernel. Install it. Then hit it from an applescript via terminal:
(this is my own use, for getting a "black" monitor back to a known-good resolution; it's tied to
an F-key by QuicKeys and as a start-up item to the master account for the computer)
----------
on run
do shell script "cscreen" (*get current resolution*)
-- returns a long string defining the screens and their resolution
-- load the result into a variable
set screenResolution to the result
-- NOTE: character 127 is a zero if the menu screen is the LCD screen,
-- and either a 1,6,7,8, if the CRT.
set LCDTest to character 127 of screenResolution as string
-- Check if menu monitor is the 21" monitor (when not zero)
if LCDTest ≠ "0" then
-- if the CRT, then force the change on that monitor
do shell script "cscreen -f -s 1 -d 32 -x 1152 -y 870 -r 85"
else
-- if the LCD, then force the change on the other monitor (i.e. on the CRT)
do shell script "cscreen -f -s 2 -d 32 -x 1152 -y 870 -r 85"
end if
end run
----------
My Notes:
NOTES:


• Screen Index #1 is always the monitor which had the menu bar at time of start-up, even if you change the menu bar default to a second monitor
• The LCD monitor always has a refresh rate of ZERO, and thus this is an easy way to test for the presence of the LCD (character 127 will be zero for the LCD, 1/6/7/8 for the CRT).
• The G4 tower's circuitry believes only the resolution of 800x600@60Hz is "Safe" for my 21" CRT -- ironically, it's one of the resolutions that isn't supported at all! Thus, in order to force a resolution switch to something other than 800 x 600 @ 60Hz, you must use the -f switch to "force" the system to take the resolution irrelevant of the "safety status" of that resolution. You can not force the LCD into a false resolution (it simply won't take it).


The full command set for cscreen is:
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 have the menu bar
[-h] : displays the usage


Note: Using -p will change the display index so you will likely want to use -l again to show the current displays if you wish to use -p a second time.

Cheers
=-= Marc Glasgow
Apple Mac Macintosh Consultant since 1990, Tampa, FL
www.cyberpoet.net

Hi

I would like to use applescript for setting the reoloution for my
projector and the mac,  I need an applescript to set the monitor to
projector and then change the reoloution to 1280*960, I found one that
I can use cscreen and changing the monitor but I need to change the
projector resoloution. Can you help me?

thanks

-Popak
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: setting up resoloution
      • From: Steven Sanders <email@hidden>
  • Prev by Date: Re: [ANN] New comprehensive AppleScript book
  • Next by Date: strange "do shell script" failure
  • Previous by thread: setting up resoloution
  • Next by thread: Re: setting up resoloution
  • Index(es):
    • Date
    • Thread