Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Monitor resolution




Le 31 mai 07 à 23:46:10, Oakley Masten a écrit :

Hi All

OK another simple question.
How do I get monitor resolution and screen bounds?

I'm sure it is simple - I just can't find it :)

Thanks
Oakley

Here is an old message:

De :   email@hidden
Objet : Rép : dimensions of the visible region of the main monitor
Date : 19 mars 2007 21:21:56 HNEC
À :   email@hidden

On 03/19/07, David Hoerl <email@hidden> wrote:


I'd like to get the dimensions of the visible region of the main
monitor. Something like this:

         set mainScreen to call method "mainScreen" of class "NSScreen"
         set [x1, y2, x2, y2] to call method "visibleFrame" of mainScreen

I'd like to do this in a vanilla script, not within AppleStudio. I
looked in Standard Additions but didn't see it there.


Your best bet is to get cscreen, available at
<http://browsershots.org/downloads/thirdparty/cscreen.dmg>, put it into
/usr/local/bin/, and use the command: do shell script "/usr/local/bin/cscreen".
The help command for csreen is:

cscreen -h
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]           : forcessettings (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

Sample output:

1 display found
Index     Depth     Width     Height  Refresh(Hz; LCD displays show 0)
    1        32      1600       1200 75


Yvan KOENIG
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.