Get Coordinates For Windows With Mac's JavaScript For Automation
This pulls the window coordinates for a single app.
Code
#!/usr/bin/env osascript -l JavaScript
const appName = "iTerm2";
const windowCount = ..;
NOTE: This may not work with all apps. When setting window positions a different method needs to be used.