Advanced application window management scripting

Calling all windows management experts!!!

I have an application that I need to control the placement of the windows. So that we care tiling the windows in a grid.

I have figured out how to do this but there are times that the application shows windows that are empty or a background. I need to be able to tell it to ignore the null set windows windows name “” and then manage the remaining windows.

The one wrinkle is that one of the windows typically the last one is also named “” and is a black background.

I have been able to make that window enlarge to the background.

here is a snippet of the code.


set ULX to 54
set ULY to 53
set LRX to 1920 - 55
set LRY to 1080 - 81
set displaySizeX to 1920
set displaySizeY to 1080


tell application "XXX"
			set wCount to count windows
			set wList to name of windows
		
		end tell
		
		#repeat with counter from 1 to wCount
		if (wCount > 1) and (item wCount of wList = "") then
			tell application "XXX" to set the bounds of window wCount to {0, 0, displaySizeX, displaySizeY}
			set wCount to wCount - 1
		end if
		if wCount = 1 then
			tell application "XXX"
				set the bounds of window 1 to {ULX, ULY, LRX, LRY}
			end tell
		else if wCount = 2 then
			tell application "XXX"
				set the bounds of window 1 to {(LRX + ULX) / 2, ULY, LRX, LRY}
				set the bounds of window 2 to {ULX, ULY, (LRX + ULX) / 2, LRY}
			end tell
		else if wCount = 3 then
			tell application "XXX"
				set the bounds of window 1 to {(LRX + ULX) / 2, ULY, LRX, (LRY + ULY) / 2}
				set the bounds of window 2 to {ULX, ULY, (LRX + ULX) / 2, (LRY + ULY) / 2}
				set the bounds of window 3 to {ULX + (LRX - ULX) / 4, (LRY + ULY) / 2, ULX + 3 * (LRX - ULX) / 4, LRY}
			end tell
			#end if

So I need to modify it to not make some of the “” windows to not be mapped.

here is an example output for the windows that apple script finds

get name of every window
in this case the first window needs ignored in my window management.
{“”, “windowA - 406x720”}

In this case it os doing what i want. window A is on left side window B is on right side. window “” is streaked to whole screen(black background)
get name of every window
{“windowA - 406x720”, “windowB - 1152x720”, “”}

Scott