I needed a way to find a window before using sendkey(s). It wasn't working well with what I had been using previously, and the only solution I could find required adding modules to every machine which means that it's brittle.
This code solves the problem I had.