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