Browse the docs

Open Finder selection

Opens whatever is selected in the Finder, optionally with a chosen app.

Open the Finder selection in app

Keyboard Maestro: OpenFinderSelection

Details #

Reads the items currently selected in the Finder and opens them, the same as pressing ⌘O on them. With app, they open in that app instead of their default one.

app can be an app's name (TextEdit) or its bundle identifier (com.apple.TextEdit). A value that contains a dot, has no spaces and does not end in .app is treated as a bundle identifier. Anything else is treated as a name.

The output is the number of items opened.

Parameters #

ParameterTypeRequiredValuesWhat it does
apptextThe app to open the items with. Leave it empty or out to use each item's default app.

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

Examples #

Open the selected files in TextEdit. This really opens them:

Open the Finder selection in TextEdit (really opens files)
Do
  1. Open the Finder selection in TextEdit
Open in Switchboard to try it

Gotchas #

  • With nothing selected the step fails with "nothing is selected in the Finder".

  • The selection is read from the Finder with a script. The first time, macOS asks whether Switchboard Engine may control Finder. If you decline, the step fails and names the Automation pane in System Settings > Privacy & Security.

  • It reads the selection of the Finder, not of whichever app is in front. Use it when the Finder is the front app, for example from a macro run by a hot key in the Finder.

  • In a dry run the step is simulated.

See also #

Open file or folder, File operation