There is the option in the command screen to send commands to a specific target, and if that target is lost to stop processing. There is also an option to continue if the focus comes back (pauses the command). Outside of that, you'd want to capture the initial window title and then, Perform a Window Function > Display, using that title.