Re: Main screen size
Re: Main screen size
- Subject: Re: Main screen size
- From: "Marc K. Myers" <email@hidden>
- Date: Wed, 24 Jan 2001 11:40:32 -0500
- Organization: [very little]
Chris Banford wrote:
>
Date: Wed, 24 Jan 2001 10:32:56 +0100
>
Subject: Main screen size
>
From: "Chris Banford" <email@hidden>
>
To: email@hidden
>
>
Here comes the next (simple?) question:
>
>
How can I get the size (in pixels) of the main screen? I'm using Akua Sweets
>
if that's a help. (this would be a good addition to the 'Newbies' collection
>
that someone out there should be putting on a web site - would be easier
>
than answering how to trap a 'Cancel' msg from a dialog 3x a day...)
>
>
Newbie gives thanks in advance to 'o-mighty AS scripting gods' out there,
There's probably a way to do it with Akua, but I don't know it. I'd use
the "Jon's Commands" scripting addition, which has a "screen list"
command. This returns a "screen info rec" with the following fields:
Class screen info object: A record describing a monitor configuration.
Properties:
name string -- The name of this type of screen.
screen id integer -- The unique id of the screen.
screen size point -- The height and width of the screen.
bounds bounding rectangle -- The boundary rectangle for the screen.
refresh rate integer -- The refresh frequency of this monitor (DM2 only).
color depth small integer -- The screen color depth setting.
in color boolean -- If the screen is in color (versus grayscale).
has menu bar boolean -- If this is the main screen which the menu bar
is on.
supported resolutions a list of record -- The resolutions supported
by this monitor (DM2 only).
resolution index integer -- The index into the supported resolutions
list for this resolution.
safe resolution boolean -- Is this resolution safe or does it require
user confirmation?
The documentation that comes with the OSAX describes the structure of
the record in great detail, which is good because it has repetitive
occurrences in it.
Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074
[1/24/01 11:38:06 AM]