This is part of my "Claude Code environment" series. Last time, in · *
Snap 8 Windows into a Grid on an Ultrawide in One Command — a Swift + AppleScript Convergence Loop and 5 Traps
- ▸ The problem: dragging windows into place cost me a minute
- ▸ Design core ①: Convert visibleFrame to global coordinates in Swift and hand it to the shell
- ▸ Design core ②: AppleScript's convergence loop
- ▸ The traps I hit
- ↳ ① Window name references break down while the spinner is rotating
- ↳ ② A position set right after size is ignored without a delay
- ↳ ③ Terminal's row-height rounding keeps the cell height off the specified value
- ↳ ④ visibleFrame sometimes doesn't subtract the menu bar
- ↳ ⑤ Transient errors (-10006 / -1728) recover naturally on retry
- ▸ Usage and verification
- ▸ Wrap-up
SOCIAL SHARE CARD GENERATOR