Re: Getting screen resolution the Safari way
Re: Getting screen resolution the Safari way
- Subject: Re: Getting screen resolution the Safari way
- From: John W Baxter <email@hidden>
- Date: Wed, 8 Jan 2003 21:49:55 -0800
At 16:28 +0000 1/8/2003, Mr Tea wrote:
>
Scripting limitations in OS X have spawned some ingenious but contorted ways
>
of getting the size of the desktop (eg, Paul Skinner's handler for digging
>
it out of the windowserver plist file), so I was interested to notice the
>
comparatively straightforward method demonstrated in the Safari
>
'Side-by-Side' script...
>
>
on desktop_size()
>
tell application "System Events"
>
tell process "Finder"
>
repeat with i from 1 to the count of windows
On my machine (Mac OS X 10.2.3 plus December Developer tools and the
related new system events thing), the line above errors and control goes to
the on error block in the calling code (not shown), which puts up a rather
generic message I don't remember.
>
if the position of window i is {0, 0} then
>
return the size of window i
>
end if
>
end repeat
>
end tell
>
end tell
>
end desktop_size
>
>
>
It's till not very intuitive, though; rather as if a bunch of builders had
>
put up a house, then found they'd forgotten to include any doors but worked
>
out a way to get in by jimmying open the pantry window.
Actually, the builders were trying to get out. ;-)
I found the above error while poking around trying to answer a query at
the Seattle dbug (which started out standing for "downtown Business users
group" with a capital B: dBug, and now simply stands for dbug) BBS. The
query said that none of the sample scripts work for him.
Anyone else having all the samples fail?
-John
--
John Baxter email@hidden Port Ludlow, WA, USA
_______________________________________________
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.