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


Click here to return to the 'some suggestions..' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
some suggestions..
Authored by: airdrummer on Dec 30, '06 11:07:13AM
u can apply a script to the frontmost application:
       tell frontmost application
why check for n==0 when you later do if(n>0)? just move everything after ur return inside the if (and everything else 4 that matter...i hate redundant code;-)
	if (n > 0) then 		-- Dividing by zero is bad
		tell application "Finder"
			set screenSize to bounds of window of desktop
			set screenWidth to item 3 of screenSize
			set screenHeight to item 4 of screenSize
		end tell
		set windowWidth to screenWidth / n
		activate
		-- Position each window in turn
and applescript's repeat is full-featured: u don't have 2 code an exit repeat...
		repeat with x from 1 to n
			tell window x to set bounds to {windowWidth * (x - 1), 0, windowWidth * x, screenHeight}
		end repeat
	end if
u also might want to set a lower bound on the width...

[ Reply to This | # ]
some suggestions..
Authored by: lxmorj on Dec 30, '06 03:51:31PM

Yeah, I meant to take the check for if zero return bit out when I put the if n >0 in, but I overlooked it. Also, thanks for the tip on the repeat. The only problem with frontmost application I have come across is that some applications do not respond well to the current code. I personally only have a use for it with Safari. Anything more than around five windows becomes insanely useless, so I am not sure what good a minimum width would accomplish... baba, i will look into it : )



[ Reply to This | # ]