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


Click here to return to the 'Tile then restore the active app's window positions and sizes' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Tile then restore the active app's window positions and sizes
Authored by: philostein on May 11, '09 04:27:27PM

Change the _screenWidth variable to 1200, then use this code in place of the current code:

-- Makes an almost screen size window with a bit of space to drag n' drop files to windows behind.
if _count is 1 then
set position of window 1 of _process to {80, 22}
set size of window 1 of _process to {1200, 778}
end if

-- If there are 2 or 3 or 4 windows, it's easy to split the windows across the width of the screen while retaining decent size windows.
-- Change properties _screenWidth and _screenHeight for different size screens. (See top of script.)

if {2, 3, 4} contains _count then
repeat with i from 1 to _count
set position of window i of _process to ({((_screenWidth / _count) * (i - 1)) + 80, 22})
set size of window i of _process to {(_screenWidth / _count), (_screenHeight - 22)}
end repeat
end if

-- Windows 5-12 are split vertically too.
if _windowsTileNumbers contains _count then
repeat with i from 1 to (_count / 2 round rounding up)
set position of window i of _process to {((_screenWidth / (_count / 2 round rounding up)) * (i - 1)) + 80, 22}
set size of window i of _process to {(_screenWidth / (_count / 2 round rounding up)), ((_screenHeight - 22) / 2)}
end repeat

repeat with i from (_count / 2 round rounding up) + 1 to _count
set position of window i of _process to {((_screenWidth / (_count / 2 round rounding up)) * (i - ((_count / 2 round rounding up) + 1))) + 80, ((_screenHeight - 22) / 2) + 22}
set size of window i of _process to {(_screenWidth / (_count / 2 round rounding up)), ((_screenHeight - 22) / 2)}
end repeat
end if


Basically, I just put a ( )+80 wrapper around the horizontal part of the 'set position of window' lines.

Hope it works OK,

PhilHints.



[ Reply to This | # ]