Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'A script to resize frontmost two windows to fill screen' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A script to resize frontmost two windows to fill screen
Authored by: dkulp on Jan 25, '06 07:38:44AM
For what it's worth, all of the scripts in this thread try to determine the screen size by scanning through the com.apple.windowserver plist. Unfortunately, this just doesn't work if you have multiple DisplaySets. For example, on my laptop:
% defaults read /Library/Preferences/com.apple.windowserver | grep -w Width
                Width = 800; 
                Width = 1024; 
                Width = 1024; 
                Width = 1024; 
                Width = 1024; 
                Width = 1920; 
                Width = 1024; 
                Width = 800; 
                Width = 800; 
                Width = 1680; 
                Width = 1024; 
                Width = 1024; 
                Width = 1024; 
                Width = 800; 
                Width = 1024; 
                Width = 1024; 
                Width = 1024; 
                Width = 1680; 
                Width = 800; 
                Width = 800; 
                Width = 800; 
                Width = 800; 
                Width = 1680; 
                Width = 1024; 
                Width = 1680; 
                Width = 1024; 
                Width = 800; 
                Width = 800; 
                Width = 1680; 
                Width = 1024; 
                Width = 1680; 
                Width = 1024; 
                Width = 1680; 
                Width = 1024; 
                Width = 1680; 
                Width = 800; 
                Width = 800; 
MacOS apparently remembers every display that you've used (and you can see that I have used many).

What we want is to find the current display dimensions, but that's not indicated in this plist. I found a post elsewhere that asked Safari to run a JavaScript that returns screen.availHeight and screen.availWidth. Extra Suites provides an AppleScript extension with screen dimension information.

I don't know a general, free solution to get the screen dimensions.

[ Reply to This | # ]

A script to resize frontmost two windows to fill screen
Authored by: craigw on Jan 23, '07 04:57:38PM

here's what I put in for getting the desktop size:
set screenWidth to (do shell script "system_profiler SPDisplaysDataType | grep Resolution | awk '{print $2}'")
set screenHeight to (do shell script "system_profiler SPDisplaysDataType | grep Resolution | awk '{print $4}'")



[ Reply to This | # ]
A script to resize frontmost two windows to fill screen
Authored by: Clark_Kent on Nov 25, '07 01:31:41PM

Here's a link to some great window maneuvering apple scripts:

http://jon.smajda.com/blog/?p=609



[ Reply to This | # ]