For giggles, here's a macro that'll collect the details of the first 1-4 windows of the first 1-4 apps, only fronting the first window of each app for minimum disruption (reasonable if you are trying to grab a multi-app window layout), using "native" KM Actions where possible.
You'll end up with something like (run for 3 apps and 3 windows):
/Applications/Keyboard Maestro.app•••Keyboard Maestro Editor — Scratch 2•••1264,103,1195,1222
/Applications/Keyboard Maestro.app•••Keyboard Maestro Editor — Scratch 3•••962,185,1164,1222
/Applications/Keyboard Maestro.app••••••0,0,0,0
/System/Applications/Utilities/Script Editor.app•••Untitled 253.scpt•••825,476,700,730
/System/Applications/Utilities/Script Editor.app•••Keyboard Maestro Engine.sdef•••194,179,1000,680
/System/Applications/Utilities/Script Editor.app•••Untitled 252.scpt•••1680,594,700,730
/System/Volumes/Preboot/Cryptexes/App/System/Applications/Safari.app•••token:Application Tokens [Keyboard Maestro Wiki]•••-1483,25,1457,1415
/System/Volumes/Preboot/Cryptexes/App/System/Applications/Safari.app•••Screen Studio — Professional screen recorder for macOS•••29,25,962,1415
/System/Volumes/Preboot/Cryptexes/App/System/Applications/Safari.app•••Latest topics - Keyboard Maestro Discourse•••275,25,1457,1415
...which should be easy (he said, hand-waving furiously
) to iterate through later to generate "Manipulate Window" Actions on the fly, dynamically targeting by both app path and window title to set frames.
Note the missing title and the frame of 0,0,0,0 on line 3, because the KM Editor only had 2 windows open. Easy error handling, FTW!
Collect Windows of Apps.kmmacros (7.0 KB)
Image
But just because it can be done doesn't mean it should be 