Browse the docs

Activate app

Brings an app to the front, launching it first if it is not running.

Activate app

Keyboard Maestro: ActivateApplication

Details #

Activate puts the named app in front. If the app is not running, Switchboard launches it, then waits up to about a second and a half for it to become the front app.

Name the app by bundle id (com.apple.Safari) or by its name (Safari). A bundle id is safer: names change with the system language. The step also accepts bundleId or name as other spellings of app.

When it finishes, the step's output holds the app's name and bundleId.

Parameters #

ParameterTypeRequiredValuesWhat it does
allWindowsyes / noAlso brings all the app's windows forward. Off by default.
apptextThe bundle id or the name. One of app or bundleId is required.
bundleIdtextSame as app. Use whichever you like.
ifFrontone ofswitchLast bringAll reopen hideOthersWhat to do when the app is already in front: switchLast (switch to the previous app), bringAll (bring all its windows forward), reopen, or hideOthers. Without it, nothing more happens.
launchyes / noDefaults to on. Turn it off to bring an app forward only if it is already running; if it is not, the step fails with "isn't running" instead of launching it.

Every step also accepts label, onFailure, timeout and dryRunSafe.

Examples #

Bring Safari forward (really switches apps)
Do
  1. Activate ‹app›
Open in Switchboard to try it

Only switch to an app that is already open, and stop quietly when it is not:

Switch to Mail only if it is open (really switches apps)
Do
  1. Activate ‹app›
  2. Show “Done” for 1 s
Open in Switchboard to try it

Gotchas #

  • An app that opens slowly may not have a window yet when this step finishes. Follow it with Wait on a window title before you type or click.

  • A name that matches no installed app fails with "no app called". Use the bundle id.

  • Activate does not open a document. Use Open file or folder for that.

Recorded when #

The Recorder writes this step when you switch to another app while recording (⌘Tab, the Dock, or clicking its window). See Recording a macro.

See also #

Wait, Quit app, Hide app, Open file or folder