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 #
| Parameter | Type | Required | Values | What it does |
|---|---|---|---|---|
allWindows | yes / no | Also brings all the app's windows forward. Off by default. | ||
app | text | The bundle id or the name. One of app or bundleId is required. | ||
bundleId | text | Same as app. Use whichever you like. | ||
ifFront | one of | switchLast bringAll reopen hideOthers | What 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. | |
launch | yes / no | Defaults 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 #
- Activate ‹app›
Only switch to an app that is already open, and stop quietly when it is not:
- Activate ‹app›
- Show “Done” for 1 s
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.