Detecting windows in Spaces not currently visible (v9.0.6)

I modified the subject line to make it clearer what the issue is after I've played with this for a while. my 2nd reply below has the issue now.

Launch LastPass Macro (v9.0.6)

I wanted a macro to quit and relaunch LastPass. Basically it's the fastest way to bring the window to my current workspace when I've left it running on one of my many workspaces.

Simple, just use the Quit & Relaunch: LastPass quits, doesn't relaunch.
What about Force Quite & Relaunch? Same, LP quits, no relaunch.
Maybe it takes awhile before trying a relaunch:

  • quit
  • pause .25 seconds
  • activate app

Nope, quit works, no launch. Right-click just the Activate action and Try Action that seems ok. Try again, app quits, no relaunch, immediately do Try Action on the activate, still doesn't work. Wait a bit, try again. This time Try Action works. Maybe the pause in quit/pause/activate is too short. Boost it to 1 second then 1.5 seconds. No luck.

Finally I hit on the attached macro. Quit the app, pause. Do a launch, pause again, then finally do a second launch. This seems to work almost every time (I've had one failure in testing, have't replicated).

I tested the other methods with other apps (usually pcalc or OmniFocus) and they worked fine without needing to launch twice.

Anybody else seen something like this? Seems like it's a LastPass issue but I'm not sure how as it's an OS launch command.

OS: macOS Catalina 10.15.7
Keyboard Maestro: 9.0.6
LastPass: 4.59.0

eh, I figured out some of this. LastPass doesn't actually quit when you cmd+q (or issue the quit command) it runs as a menu application as well and when you quit it only closes the window. If you quit from the menu application it won't if the extensions is running in Safari, you get a warning instead.

I'm working on closing & reopening the Vault window instead but having problems with that as Keyboard Maestro doesn't seem to recognize a window if it is in a workspace that isn't currently shown in a visible workspace.

Keyboard Maestro "If any window title of" won't identify a window if it isn't on a Space currently shown on one of the monitors.

I have 2 monitors and Mission Control configuration has "Displays have separate Spaces" turned on, I have multiple desktops on each display. I put the window I'm testing with (I've tried both Last Pass and Plex) on the 2nd monitor then switch that monitor to a different Desktop. The window is still open but the condition of the IF statement switches to Currently False as soon as I switch the desktop).