Hi,
while sorting files hoarded over the years, thought I cud arrange finder windows (cud be other apps too) on one of the screen (I have two)
First Take, which works
tell application "Finder" to set {a, b, c, d} to bounds of window of desktop
--3x3 Matrix
set nCol to 3
set nRow to 3
set w to (c - a) / nCol
set h to (d - b) / nRow
set win1 to {(a + 0 * w), (b + 0 * h), (a + 1 * w), (b + 1 * h)} --LeftTop
set win2 to {(a + 0 * w), (b + 1 * h), (a + 1 * w), (b + 2 * h)} --LeftMid
set win3 to {(a + 0 * w), (b + 2 * h), (a + 1 * w), (b + 3 * h)} --LeftBottom
set win4 to {(a + 1 * w), (b + 0 * h), (a + 2 * w), (b + 1 * h)} --MiddleTop
set win5 to {(a + 1 * w), (b + 1 * h), (a + 2 * w), (b + 2 * h)} --MiddleMid
set win6 to {(a + 1 * w), (b + 2 * h), (a + 2 * w), (b + 3 * h)} --Middle
set win7 to {(a + 2 * w), (b + 0 * h), (a + 3 * w), (b + 1 * h)} --RightTop
set win8 to {(a + 2 * w), (b + 1 * h), (a + 3 * w), (b + 2 * h)} --RightMid
set win9 to {(a + 2 * w), (b + 2 * h), (a + 3 * w), (b + 3 * h)} --RightBottom
Then I tried this, which generates the bounds.
tell application "Finder" to set {a, b, c, d} to bounds of window of desktop
--3x3 Matrix
set nCol to 3
set nRow to 3
set w to (c - a) / nCol
set h to (d - b) / nRow
set Hc to "1"
repeat until Hc = nCol + 1
set Wc to "1"
repeat until Wc = nRow + 1
set winBound to {(a + (Hc - 1) * w), (b + (Wc - 1) * h), (a + Hc * w), (b + Wc * h)}
-- do something with winBound
set Wc to Wc + 1
end repeat
set Hc to Hc + 1
end repeat
Just wondering if it cud be written better,
cud take into account the "useable " area of the screen,
Assign these bounds to existing Finder windows.
I cant figure out how to count windows 1, windows 2 etc and assign them to generated bounds
Cheers