Tiling Text Windows

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
			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

Could you post a screenshot please? I want to better understand what this script is good for.

To keep the previouos thread on topic, I have split this off on its own.

It takes all of the open documents you have and organizes them into small tiled windows as you see in the top left here. This can be very useful if you are browsing/reviewing/comparing multiple documents.

1 Like

For me this is a stack - I got excited seeing the wording “tiled” hoping there is a way to have an overview of images and notes :slight_smile:

Thanks for the correction. I fixed my inaccurate description above.

Tiling is also a good idea. In fact, a contiguous tiling layout was the first elisp program I ever wrote.

I did not mean to correct you - I laughed at my reaction to the title, hoping for "cork board’ view of notes. My fault and envy for no longer being able to programme :wink: