• 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: screen size in OS X
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: screen size in OS X


  • Subject: Re: screen size in OS X
  • From: Paul Skinner <email@hidden>
  • Date: Fri, 18 Oct 2002 17:04:28 -0400

On Friday, October 18, 2002, at 01:34 PM, Jason Bourque wrote:

On 10/18/02 12:41 PM, "Mr Tea" <email@hidden> wrote:

This from Paul Skinner - dated 18-10-02 04.05 pm:

tell application "Finder"
bounds of desktop
-->{ -33, -33, 31, 31 }
end tell

Any solution?

I wish I knew.
snip
Mr Tea

Jons commands for X.
snip
I believe Jons commands should be standard issue.

Indeed. But it isn't.

Jason Bourque

OK then, it's plist hackin' time!

BEGINSCRIPT

on ScreenDimensions()
set previousTIDs to AppleScript's text item delimiters --Store the TIDs' initial value.
try
----------------SingleArgumentCore---------------
set AppleScript's text item delimiters to ""
set plistText to read file ((((path to preferences from local domain) as text) & "com.apple.windowserver.plist") as text)
set AppleScript's text item delimiters to "<dict>"
set plistText to text item 3 of plistText
set output to {}

repeat with thisDelimiter in {"<key>UnmirroredHeight</key>", "<key>UnmirroredWidth</key>"}
set AppleScript's text item delimiters to thisDelimiter
set datatext to text item 2 of plistText
set AppleScript's text item delimiters to ">"
set datatext to text item 2 of datatext
set AppleScript's text item delimiters to "<"
set datatext to text item 1 of datatext
set the end of output to datatext
end repeat
--------------------------------------------------
set AppleScript's text item delimiters to previousTIDs --Restore the TIDs to their initial value.
return the output
on error errorMessage number errorNumber partial result errorResult from errorFrom to ErrorTo
set AppleScript's text item delimiters to "" --Modify unhandled errors to include the class and name of this object.
set errorMessage to ("The " & (class of ScreenDimensions) & " '" & "ScreenDimensions" & "' generated an error." & return & the errorMessage) as text
set AppleScript's text item delimiters to previousTIDs
error errorMessage number errorNumber partial result errorResult from errorFrom to ErrorTo
end try
end ScreenDimensions



--Documentation for ScreenDimensions.
--These properties can be referenced for documentation and for version and dependency checking.
property name : "ScreenDimensions" --The name of this script object. <TEXT>
property objects : {ScreenDimensions} --A list of objects that are within this script object. <LIST>
property version : 1.0 --A version code for this object. <REAL>
property dependencies : {asDependencies:{"1.9"}, osDependencies:{"10.2.1"}, osaxDependencies:{"StandardAdditions.osax"}, handlerDependencies:{}, applicationDependencies:{}} --<RECORD>
property documentation : "ScreenDimensions Object.

ScreenDimensions will return the width and height of the main screen as a list of two integers.

Parameters: None.

Output: The width and height of the main screen as a list of two integers.

Error Handling: Errors that are not handled by ScreenDimensions internally will be modified to contain the name and class of ScreenDimensions before being thrown.

Paul Skinner 2002
email@hidden
" --<TEXT>


ENDSCRIPT

I'll do a version that reports multiple monitor's sizes and locations relative to one another later.

--
Paul Skinner

Who will ever know anthing about the deep and disturbed psyche of AppleScript? --John Delacour
_______________________________________________
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.
  • Follow-Ups:
    • Re: screen size in OS X
      • From: Mr Tea <email@hidden>
References: 
 >Re: screen size in OS X (From: Jason Bourque <email@hidden>)

  • Prev by Date: Re: Library Question
  • Next by Date: Re: Applescript Virgin Question
  • Previous by thread: Re: screen size in OS X
  • Next by thread: Re: screen size in OS X
  • Index(es):
    • Date
    • Thread