Screen size on OSX (Was: Re: Ethernet Hardware Address)
Screen size on OSX (Was: Re: Ethernet Hardware Address)
- Subject: Screen size on OSX (Was: Re: Ethernet Hardware Address)
- From: Greg Back <email@hidden>
- Date: Sat, 9 Feb 2002 14:42:00 -0500
On Saturday, February 9, 2002, at 02:03 AM, Shane Stanley wrote:
On 9/2/02 1:05 PM +1000, garbanzito, email@hidden, wrote:
do shell script "/usr/sbin/AppleSystemProfiler | grep \"Ethernet
address\""
Any way of getting screen size?
I'm not sure if this is anything close to what you're talking about, but
you could read the plist to get the information. I was too lazy to do a
complete study of the open for access/read/close access commands in
Standard Additions, so the line numbers might not be the same on
everyone's machine. The file read/write commands are not as intuitive as
I would like, and I'm sure can suggest a more general script to get the
information.
set plist to read (alias "iMac OS
X:Library:Preferences:com.apple.windowserver.plist") using delimiter {"
", " ", "<", ">"}
set AppleScript's text item delimiters to " "
set plist to plist as list
set h to item 169 of plist as integer
set w to item 313 of plist as integer
{h, w}
-->{600, 800} (OMM)
Notes: All the individual lines of the script are indented. The
character in the first set of parentheses is ASCII 10, not a normal
return (13, i think). I think the location of the plist file is standard
on all machines. Correct me if I'm wrong.
One other thing: I'm not sure, but I think it is bad to try *writing* to
the plist file, so there goes *setting* the screen size. But it's a
start.
My apologies if this scheme has been suggested before...I vaguely
remember it, but I don't know if it was just something written here or
something I was thinking about. I couldn't find a mention of it in the
archives.
--
Greg
_______________________________________________
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.