Skip to content

Foreground Changed

  • Trigger
  • Apps & windows

Starts the macro whenever something else is in front: another app, another window title (also when another app or window comes to the front), or another program file (also another copy of an app with the same name, such as in another folder).

The Foreground Changed step in the MacroWin editor
Each time another app comes to the front, its name is added to a log file, to see later where the day went.

Settings

SettingStarts asWhat it does
Starts when The app changes
  • The app changes: Another app comes to the front, such as from notepad.exe to chrome.exe.
  • The window title changes: The window in front gets another title (a browser switching tabs, an editor opening another file), or another window or app comes to the front.
  • The app's path changes: Another program file comes to the front: another app, or another copy of the same app from another folder.

Outputs

Foreground Changed outputs
AppThe app in front now, such as chrome.exe.
TitleThe title of the window in front now.
PathThe full path of the program in front now, such as C:\Windows\notepad.exe.
Previous appThe app that was in front before.
Previous titleThe title of the window that was in front before.
Previous pathThe full path of the program that was in front before.

More in Apps & windows: Full-Screen App, Virtual Desktop Changed, App Event

Build macros with Foreground Changed in MacroWin. Free to download, no account needed. Windows 10 and 11.

Download