Connect apps and files

Build a Finder Quick Action

Expose a tested file workflow in Finder while preserving explicit input and predictable output.

A Quick Action puts your automation in Finder’s right-click menu, next to the built-in ones. It’s the difference between a workflow you occasionally run and a workflow you actually use.

Take the image shortcut from earlier in this module. Open its details pane, turn on Use as Quick Action for Finder, and keep the input restricted to the file types it understands. Finder supplies the selected items as input.

details pane -> Use as Quick Action -> Finder: on
receives: Images (from Quick Actions)
if there is no input: Stop and Respond

Why the input type matters here

Restricting the input type does real work in a Quick Action. With images only, the action shows up for a selected PNG and stays out of the way for a PDF. Without the restriction it appears everywhere, and fails after the user picks it.

Finder sends a batch

Inside the workflow, treat the selection as a batch. Finder sends everything that was selected, not one item.

For each file, derive a new destination and check whether it already exists. Return the created files so Finder or the next action can reveal them.

Use it

Select one or more images in Finder, right-click, and look under Quick Actions. The first run on files in a protected folder like Desktop or Downloads can trigger a permission prompt. That’s expected. Approve it once and rerun.

Then test like you mean it:

  • one file
  • several files
  • a filename with spaces
  • an unsupported item

The several-files case is where Quick Actions differ most from terminal runs. It’s also where duplicate-name collisions surface. Watch the destination folder while you run each case, and count the results.

Keep the trigger thin

The Quick Action should collect the selection and hand it over. Nothing more. Keep the transformation logic in a script or a shared shortcut, usable from Terminal.

When the logic lives outside the Quick Action, you can test it with fixtures from the shell. And the same logic can later run on a schedule, unchanged. That’s the plan for the launchd module.

The mistake to avoid is building the whole workflow inside the Quick Action. It works. But every test now requires a hand-made Finder selection, and none of it is reusable anywhere else.

I think of it this way: the Quick Action is a button. Buttons shouldn’t contain logic. They call something that does.

Try this: select three screenshots on your Desktop, run your Quick Action, and count the files in the destination. Then run it again on the same three and see what happens to the names.

Lesson completed