Re: How do I know the number of connected Monitors (to my MacBook)?
Re: How do I know the number of connected Monitors (to my MacBook)?
- Subject: Re: How do I know the number of connected Monitors (to my MacBook)?
- From: Philip Aker <email@hidden>
- Date: Wed, 3 Jun 2009 04:08:44 -0700
On 2009-06-03, at 00:29:51, emile.a.schwarz wrote:
But, I need a way to know if an external monitor is connected; I currently do not know how to!
On 10.5, I think you can get this info by getting the sub list count of the "DisplaySets" key of the windowserver property list.
The ordering is:
array array -> dict -- monitor 1 array -> dict -- monitor 2 array -> dict -- etc.
The following just gets the details of all the monitors. You should be able to adapt it to your needs.
set f to "/Library/Preferences/com.apple.windowserver.plist" tell application "System Events" set plf to property list file f set plist to make new property list item with data plf tell plist tell property list item "DisplaySets" get value of every property list item end tell end tell end tell
Philip Aker echo email@hidden@nl | tr a-z@. p-za-o.@ Democracy: Two wolves and a sheep voting on lunch. |
_______________________________________________
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