I\'m observing NSWorkspaceDidDeactivateApplicationNotification notification to get the application that has just lost focus. I\'m ending up with an instance of NSRunningAppl
Unless the application opts to participate in IAC via AppleScript support or some other means, you simply don't touch its windows or anything else outside of your own heap space.