your first block of code appears a bit stuffeed up, that might have been during pasting into the forum
ie:
=send and
= ,getbut anyway, i think the second one doesnt work becuase %a may not have been set to 1 to start with, you dont show us it at least.
Here is replacement code that also takes into account a BUG in the /window command which causes a script error on any window name that has 91+ characters to the name.
These windows are ignored (this is all you can do)
var %a = $window(*,0)
while (%a) {
var %win = $window(*,%a), %fw = $gettok(%win,1,32)
if (((%fw == send) || (%fw == get)) && ($len(%win) < 91)) { window -h $_bracket(%win) }
dec %a
}
&
var %a = $window(*,0)
while (%a) {
var %win = $window(*,%a), %fw = $gettok(%win,1,32)
if (((%fw == send) || (%fw == get)) && ($len(%win) < 91)) { window -w $_bracket(%win) }
dec %a
}
PS: Im assuming $_bracket() adds " " to the window name