• 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
Get screen resolution (OS X)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Get screen resolution (OS X)


  • Subject: Get screen resolution (OS X)
  • From: julifos <email@hidden>
  • Date: Sun, 15 Dec 2002 15:53:48 +0000

Hi all!

Any quick way to Asvanilla-check resolution under OS X? ("old" classic way
"content space" does not work any more)...

I've been trying this code (reading file "com.apple.windowserver.plist") and
it works here, but I don't know if this is universal:

JJ

______________________

getScreenResolution()

on getScreenResolution()
(path to startup disk as text) &
"Library:Preferences:com.apple.windowserver.plist" as alias
set prefs to (read result)
set off1 to (offset of "<key>Width</key>
<integer>" in
prefs) + 30
set off2 to (offset of "</integer>
</dict>
</array>

</array>
</dict>
</plist>
" in prefs) - 1
set width to characters off1 thru off2 in prefs as text

set off1 to (offset of "<key>Height</key>
<integer>" in
prefs) + 31
set off2 to (offset of "</integer>

<key>IODisplayLocation" in prefs) - 1
set height to characters off1 thru off2 in prefs as text
{width, height}
end getScreenResolution
______________________
*if you see some "strange" character, this is ASCII character 10 (LF)
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
_______________________________________________
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.

  • Prev by Date: Re: Activating applications from a list
  • Next by Date: Re: Stuck trying to use creatorid to control IE with OS 8.1
  • Previous by thread: Message ID from Draft Window
  • Next by thread: Trouble mounting an iDisk
  • Index(es):
    • Date
    • Thread