App commands
Switches between apps, shows or hides them, brings their windows forward, reopens them, or quits the front app and the others.
Switch to app
Keyboard Maestro: SwitchToLastApplication, SwitchToNextApplication, ShowSpecificApp, ShowAll, HideCurrent, HideOthers, HideAll, QuitOthers, QuitSpecificApp, BringWindowsForward
Details #
One step for the app-wide commands that are not "bring this one app to the front" (that is Activate app) and not "quit this named app" (that is Quit app). Pick the command with action:
switchLast goes back to the app you used before this one.
switchNext goes to the next app in the order they were launched.
show unhides the app named in
app. It does nothing, and says the app wasn't running, if it isn't running.showAll unhides every hidden app, except those in
except.bringForward brings all of an app's windows in front of other apps' windows. Without
appit uses the front app.reopen sends the app the "reopen" request, which usually makes it open a new window. Needs
app.hideFront hides the front app.
hideOthers hides every app except the front app and those in
except.hideAll hides every app except those in
except, the front app included.quitFront asks the front app to quit. With
forceit is force-quit.quitOthers asks every app to quit except the front app and those in
except.
The output depends on the action: name for the switch, bring-forward and reopen actions, and a list under shown, hidden or quit for the rest. Apps are matched by bundle id or by name.
Parameters #
| Parameter | Type | Required | Values | What it does |
|---|---|---|---|---|
action | one of | Yes | switchLast switchNext show showAll bringForward reopen hideFront hideOthers hideAll quitOthers quitFront | Required. One of switchLast, switchNext, show, showAll, bringForward, reopen, hideFront, hideOthers, hideAll, quitOthers, quitFront. Any other value fails and the message lists them. |
app | text | The app's name or bundle id. Needed by show and reopen; optional for bringForward. (bundleId is accepted as another spelling.) | ||
bundleId | text | Another spelling of app. | ||
except | list of text | A list of apps (names or bundle ids) to leave alone. Used by showAll, hideOthers, hideAll and quitOthers. | ||
force | yes / no | For quitFront only: force-quit the app instead of asking it politely. quitOthers never forces. |
Every step also accepts label, onFailure, timeout and dryRunSafe.
Examples #
This switches to the next app and shows a message. A dry run simulates the switch, so nothing moves:
- Switch to the next app
- Show “Switched app” for 2 s
Gotchas #
quitFrontandquitOthersonly ask apps to quit. An app with an unsaved document may show a save sheet or refuse. OnlyquitFrontwithforceends an app without asking.switchLastfails with "there is no other app to switch to" when Switchboard has no earlier app to go back to.switchNextfails the same way when only one app is running.hideFrontandquitFrontfail with "no app is in front" when nothing is frontmost.showandreopenfail without anapp.bringForwardneeds the Accessibility permission, and fails with "isn't running" for an app that is not running.Steps that touch the Mac are simulated in a dry run, so none of these actions really run when you use Try it.