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


Click here to return to the 'A script to resize windows to their vertical maximum' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A script to resize windows to their vertical maximum
Authored by: cfoster on May 05, '05 12:01:23PM

I think this should get the screen size for you:

    
    try
    	set window_info to do shell script
    	"defaults read com.apple.loginwindow | grep -w 'NSWindow Frame About This Mac'"
    	set screen_width to (word 13 of window_info as number)
    	set screen_height to (word 14 of window_info as number)
    on error -- use defaults on failure
    	set screen_width to 1024
    	set screen_height to 768
    end try
    

Unfortunately, I just made the switch to Tiger and so I don't have 10.3 around to find out if this information is also available in the same com.apple.loginwindow domain.

-Colin.



[ Reply to This | # ]
A script to resize windows to their vertical maximum
Authored by: jdsmith on May 07, '05 01:48:30AM

Thanks, that worked in 10.3. Does the script work in Tiger as well?



[ Reply to This | # ]
A script to resize windows to their vertical maximum
Authored by: fiorix on Feb 26, '11 07:36:49AM
I've been using the Spark Daemon for a while to define custom keyboard shortcuts that executes Apple Script on Terminal.app (and any other app) in such a way that Cmd+1 to Cmd+9 switches the current tab to tab N. Today I wrote the following code to vertically maximize the Terminal:
tell application "Finder"
	set _b to bounds of window of desktop
end tell

tell application "Terminal"
	tell front window
		set {_x, _y, _w, _h} to (get bounds)
		set _vz to item 4 of _b
		set bounds to {_x, 10, _w, _vz}
	end tell
end tell
Works fine on 10.6.

[ Reply to This | # ]