Number of Displays in OS X
Number of Displays in OS X
- Subject: Number of Displays in OS X
- From: Michael Terry <email@hidden>
- Date: Thu, 4 Dec 2003 10:12:18 -0800
Does anyone know of a good (and by good I mean osaxenless) way of
getting the number of displays (monitors) that are currently running.
Order of goodness would go:
1. Works with stock install of AppleScript anywhere, anytime.
2. Works with stock install of AppleScript on recent versions of OS X.
3. Works with recent version of OS X by using a BSD subsystem
component, i.e., shell call.
4. Works by a small, free, OS X-compatible scriptable application or
command line tool.
5. Works by scripting addition and someone knows how to tell a
scripting addition directly. (*Does* anyone know how to do this? I
tried 'telling' a scripting addition and it did load the terminology
into the script, but the script didn't run properly. It also launched
Classic, for reasons I won't bother to speculate about here. How would
one fool OS X into thinking an osax were an application? If one did,
would that make it work?)
It would be a bonus if there is a compatible way to get the bounds of
each attached display, as offset from the upper left corner of the main
display. I believe that I can get that from
/Library/Preferences/com.apple.windowserver.plist once I know the
number of displays, but it's hard to verify without having more than
two sets of monitor and video card to test my assumptions. In fact, it
would almost seem possible to get the number of displays from the
plist, but I can't figure out a way. The problem, as I browse around
the web, is that some folks assume that the first element of the
DisplaySets array in windowserver.plist always contains the active
monitor(s), but that's only true 99% (or possibly more) of the time[1].
On a slightly related side-note, what does it mean when the Finder says
that my desktop bounds is {-33.-33,33,33}? I would have thought that
the desktop bounds referred to the screen size of either my main
monitor or perhaps both monitors. I would call this a bug, but I always
call it a bug that which I don't understand.
Cheers,
Mike
[1] If anyone cares--and I'm sure he doesn't--mail me off-list for the
steps to prove this.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.