I changed the loop to count down instead of up, and change the index to a Local_ name. No change in the behavior. Foreground window is fills the screen, other windows - I opened a total of 3 VS Code windows with different sizes and locations - remain unchanged.
I noticed when I print the WINDOWCOUNT , it’s 1 even though I have 3 application windows opened.
Maximize Windows.kmmacros (7.5 KB)