To save a converted or generated file in the same folder as the file you selected in Finder, pass the selected file into a Mac shortcut, get its parent directory, and use that folder as the destination for Save File. This lets the shortcut follow the input file’s location instead of saving every result to one fixed folder. The exact actions available can depend on the input and the shortcut’s macOS version.

Build the shortcut to receive a Finder file

In Shortcuts, create or open the shortcut and set it up to receive files as input. Apple documents that a shortcut run from another app can receive content from that app; file input includes documents, images, PDFs, and other files. Apple’s guide to understanding input types explains the available input types.

Open the shortcut’s Details and enable Use as Quick Action. If Finder does not offer the shortcut for the file you select, check the shortcut’s allowed input types and make sure files or the relevant file type are accepted. Apple’s steps for enabling a shortcut in Finder are in Run a shortcut while working on your Mac.

Get the input file’s parent directory

Add the action that creates the output you need—for example, an image conversion action—and ensure it receives the selected file. Then add Get Parent Directory and give it the original input file, not the converted result. The parent directory is the folder containing the selected file; it becomes the destination for the new output.

Shortcuts passes output from one action to the next when the actions’ input and output types are compatible. If the action chain does not connect as expected, inspect the action’s information by Control-clicking its icon and choosing Show Info. Apple describes these connections in Action connections in Shortcuts on Mac.

Save the result in that folder

Add Save File after the action that produces the output. Set its file input to the generated output, then set its destination folder to the result from Get Parent Directory. In the action, click or Control-click the destination field and choose the parent-directory output as a variable if it is not already connected. Leave Ask Where to Save off if you want the shortcut to save without prompting each time.

Check the output’s name and extension before relying on the shortcut. For example, a conversion should produce the converted file as the Save File input; passing the original input instead would save a copy of the source. Apple identifies Save File as a file-management share action in About share actions in Shortcuts on Mac.

Run it from Finder and check the result

In Finder, Control-click a supported file and choose Quick Actions, then select your shortcut. Apple notes that Finder Quick Actions can be enabled under System Settings > Privacy & Security > Extensions > Finder if the shortcut is missing. Apple’s Finder instructions cover the setup and launch steps.

Try it first with a file in a folder where you can easily inspect the result. Confirm that the new file appears beside the input and has the expected name and format. If the input is on an external drive, network location, or a folder the shortcut has not accessed before, macOS may require access to that location; a permission prompt or unavailable folder can prevent saving. If the parent directory cannot be selected as the Save File destination in your shortcut, use Ask Where to Save and select the folder at runtime, or choose a fixed destination. A fixed destination will not follow the input file automatically.

A successful run depends on the shortcut receiving the original file and passing a folder value—not a typed path string—to the save destination. That keeps the workflow tied to the selected file’s actual folder while leaving you in control of whether to save automatically or choose a location each time.

Sources