KeyRoutines
TriggerFreetrigger.app.focused

Run a routine when you switch to an app on Windows 11

App focused starts a routine when a chosen app becomes the active window, or when you leave it for another app. It lets your PC adapt to what you're doing without pressing anything.

How it works

  • Pick the app or game and choose whether to fire when it comes to the front or when it loses focus.
  • It listens for Windows' own "window in front changed" signal, so it reacts right away without checking repeatedly.
  • The app, its process and the window that came to the front are passed to the routine.

Routines that use it

Quiet music while you call

When your meeting app comes to the front, App volume lowers your music player; when it loses focus, another routine turns it back up.

Focus layout for writing

When your writing app gets focus, Show desktop minimizes everything else on that monitor.

Language per app

Switching to a chat app runs Switch keyboard layout to change to the language you type there.

Settings

SettingWhat it does
AppThe app or game to watch.
OnFire when it comes to the front, or when it leaves it.

Good to know

  • Web links can't be watched, because they aren't an app KeyRoutines can identify.

Questions

Can Windows run something automatically when I open a certain window?
Not on its own, but App focused does it. It runs your routine each time that app becomes the active window.
Does it fire again every time I switch back?
Yes. It fires each time the app in front changes to the chosen app, or away from it if you picked "loses focus".

Pairs well with

Build this routine in KeyRoutines

Free from the Microsoft Store for Windows 11 and 10. Pro is a one-time upgrade.