Re: dimensions of the visible region of the main monitor
Re: dimensions of the visible region of the main monitor
- Subject: Re: dimensions of the visible region of the main monitor
- From: John Baltutis <email@hidden>
- Date: Mon, 19 Mar 2007 13:21:56 -0700
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
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden