Browse the docs

currentApp

Returns the name of the app in front right now.

Keyboard Maestro: CurrentApplication

Details #

currentApp() takes no arguments and returns the name of the frontmost app as text, such as Safari.

Parameters #

Takes 0 arguments. {{ currentApp() }}

Examples #

currentApp()
→
currentApp() == "Finder"
→ false

Gotchas #

  • When a macro is started from a hotkey, the front app is the one you were using, because Switchboard does not take focus.

  • Calling it with any argument is an error: currentApp() takes 0 arguments, got 1.

  • When no real Mac is behind it (tests, previews) or the Mac can't answer, it returns empty text.