Hey Mitchell,
I prefer to use AppleScript for that sort of thing when possible, but it's easy enough iterate through windows by index with Keyboard Maestro:
If you look at my List Windows Keyboard Maestro Can See v1.1 macro you'll find some more techniques.
-Chris