Closing Windows After Log In

Relatively new to Keyboard Maestro so I apologize if this has been addressed before, but on MacOS Ventura Apple seems to have now taken away the option to 'hide' the application upon startup as there was previously. So whenever I log into my Macbook I always have to close a couple of windows (specifically Text Expander and Keyboard Maestro) to get them out of the way. I want the applications open, just the windows closed.

Is there an easy Macro that I can set up so that after I log in to my mac it automatically closes those open windows? The menu function is Command-H. I tried setting up a Macro with Login as the trigger and then the action: Type Command-H Keystroke with a short pause in between. But that didn't work as I think the Login trigger is for KM log-in rather than the system log-in. Anyway, any help would be appreciated.

I contacted Text Expander support and they are working on a solution to this as may be the case with KM.

This doesn't close windows -- it hides the application but the windows remain. This is probably what you want, but I mention it just in case...

You should post your macro so people can see what you are doing, but it sounds like you aren't activating the appropriate application before sending the ⌘H keystroke. You don't need to do this anyway -- use the "Hide Application" action instead, but do include some kind of pause or else you'll hide the app which will then activate to open a window!

Something like like this may be enough (I don't have Text Expander so have used TextEdit instead) -- note that the "Pause" condition has a 1 minute timeout and doesn't abort, so it won't get stuck waiting for apps that didn't launch at login for any reason:

Hide After Login.kmmacros (3.7 KB)

Image

Is Keyboard Maestro in your Login Items list or Keyboard Maestro Engine? It should be the latter, which you get by clicking this checkbox in the KM General Preferences.

1 Like

Thanks for that tip.

That worked to hide KM at log-in.

The TextExpander window is still an issue and they are aware of this.

The KM macro that worked to hide TE was simple enough.