Here’s an AppleScript script that diagonally stacks all the text windows while using minimal desktop area (while still displaying a readable title bar).
I’ve saved it as DT_min_wins___Cmd-Ctrl-Alt-W.scpt
(The “W” stands for “windows.”) Here it is:
set x_step to 10
set y_step to 32 -- Was 18, before the giant Title Bars appeared in OS 12.
set x_start to 11
set y_start to 38 -- Was 23.
set x_mag to 622 -- 622 so that Styles dropdown shows
set y_mag to 193 -- UX minimum is 293, but leave it like this to show recency of cleanup.
set x1 to x_start
set x2 to x_start + x_mag
set y1 to y_start
set y2 to y1 + y_mag
set good_wins to {}
tell application "DEVONthink 3"
set doc_wins to document windows
repeat with i in reverse of doc_wins
try
set test to id of i
copy i to end of good_wins
end try
end repeat
repeat with i in good_wins
set bounds of i to {x1, y1, x2, y2}
set index of i to 1
set x1 to x1 + x_step
set y1 to y1 + y_step
set x2 to x2 + x_step
set y2 to y2 + y_step
end repeat
end tell