1#!/bin/sh
2
3# get running app signatures and filter out background apps
4roster | sed -n 's/)$//;s/^ *//;/[^64] (/s/ .*(/\t/p' | while read team app; do
5	echo "# team $team $app"
6	c="$(hey "$team" count Window | grep result | cut -d" " -f 7)"
7	let c="$c - 1"
8	for w in $(seq 0 "$c"); do
9		title="$(hey "$team" get Title of Window "$w" | sed -n 's/"$//;/"result"/s/.*TYPE) : "//p')"
10		frame="$(hey "$team" get Frame of Window "$w" | sed -n 's/)$//;/"result"/s/.*TYPE) : BRect(//p')"
11		echo "hey \"$app\" set Frame of Window \"$title\" to \"BRect($frame)\""
12	done
13done
14