• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How do I know the number of connected Monitors (to my MacBook)?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >How do I know the number of connected Monitors (to my MacBook)? (From: "emile.a.schwarz" <email@hidden>)

  • Prev by Date: How do I know the number of connected Monitors (to my MacBook)?
  • Next by Date: Re: Same code gives different answers in 2 different scripts
  • Previous by thread: How do I know the number of connected Monitors (to my MacBook)?
  • Next by thread: How can I tell if server ftp folder upload is finished?
  • Index(es):
    • Date
    • Thread