To open a specific folder with a keyboard shortcut on Mac, create a shortcut in Apple’s Shortcuts app that opens a fixed folder path in Finder, then assign it a key combination. The walkthrough below uses one disposable example folder and checks that it exists before opening it.
Choose the right shortcut for your folder
This guide is for a Mac desktop user who repeatedly opens the same local folder and wants to reach it from another app with one key combination. The custom workflow uses a short shell script inside Shortcuts. Apple documents both running scripts in Shortcuts and assigning keyboard combinations to shortcuts. Meet Shortcuts for macOS, Run a shortcut while working on your Mac.
Before building it, check whether Finder already provides the keyboard shortcut you need. These built-in combinations work in Finder:
| Folder or task | Finder keyboard shortcut |
|---|---|
| Open Documents | Shift-Command-O |
| Open Downloads | Option-Command-L |
| Open your home folder | Shift-Command-H |
| Enter a particular folder path | Shift-Command-G |
Apple lists these combinations in its Mac keyboard shortcuts reference. For an occasional visit to a custom folder, activate Finder, press Shift-Command-G, paste its pathname, and press Return. Finder’s documented pathname navigation supports this approach. Go directly to a specific folder on Mac.
For a folder you open throughout the day, continue with the custom shortcut. Its destination is stored in the script, so you do not need to select a Finder item or supply a path each time.
Prepare and verify the destination folder
Use an empty example folder first. In Finder, choose Go > Home, then choose File > New Folder and name the folder Folder Shortcut Demo. If that name already exists, choose a different unused name and make the same change in the script below. Finder also supports Shift-Command-N for creating a folder. Mac keyboard shortcuts.
Confirm the location before setting up the automation. In Finder, press Shift-Command-G, enter ~/Folder Shortcut Demo/, and press Return. The tilde represents your home folder in Finder’s pathname field. You should arrive inside the empty example folder. Go directly to a specific folder on Mac.
For a different destination later, obtain its complete pathname rather than reconstructing it from memory. Apple documents this Finder method: right-click the folder, hold Option, then choose the command ending in as Pathname. Specify files and folders in Terminal on Mac.
Create the folder-opening shortcut
Open Shortcuts and click the add button to create a new shortcut. Name it Open Folder Shortcut Demo. Apple’s manual creation workflow lets you name a shortcut, add actions from the action library, and test it using the run button. Create a custom shortcut on Mac.
Search the action library for Run Shell Script and add that action. Set its Shell option to /bin/bash. Replace its sample script with the complete script below. Apple documents built-in shell scripting support in Shortcuts; the workflow here combines that support with macOS’s documented open command. Meet Shortcuts for macOS, Execute commands and run tools in Terminal on Mac.
target="$HOME/Folder Shortcut Demo"
if [ ! -d "$target" ]; then
printf 'Folder not found: %s\n' "$target" >&2
exit 1
fi
/usr/bin/open -a Finder "$target"
This is a complete script for the example folder, with no additional files or packages required. It uses the existing HOME environment variable to construct the destination, checks that the destination is a directory, and passes its path to Finder through open. Apple’s command documentation describes selecting an app with open -a, while its command-line primer describes opening items in a chosen application. Execute commands and run tools in Terminal on Mac, Command Line Primer.
Keep the quotation marks around the pathname and variable. They keep the example’s spaces within one argument. Apple documents quoting paths containing spaces in its Terminal pathname guide.
If Shortcuts requests that scripts be enabled, choose Shortcuts > Settings, open Advanced, and select Allow Running Scripts. Those are Apple’s documented controls for allowing scripts to run from a shortcut. Advanced Privacy and security settings in Shortcuts on Mac.
Click the shortcut’s run button. Finder should display the example folder. The script passed a Bash syntax check during preparation of this article; its macOS interface behavior was not executed here, so complete this Finder test on your Mac before assigning the keys.
Understand what the action receives and returns
This workflow supplies its own path as text inside the script. It does not use Shortcut Input, selected files, or standard input. Leave it independent of whatever content happens to be selected in the frontmost app.
The script produces no intentional standard output on success. Its useful result is the folder opening in Finder; it does not return a Shortcuts folder object. On the missing-folder branch, it writes a diagnostic to standard error and exits with status 1. No following action needs to consume its output.
That distinction matters if you extend the shortcut later. Apple lists Text, Files, and Folder as separate input types. A text pathname should not be described as though it were already a folder object. To inspect an action’s declared inputs and outputs on your installed version, Control-click its icon and choose Show Info. Understanding input types in Shortcuts on Mac, Navigate the action list in Shortcuts on Mac.
Assign and test the keyboard shortcut
Once the run-button test works, open the shortcut’s details using the details button. Click Add Keyboard Shortcut and press your preferred combination. For example, try Control-Option-Command-O if it is available on your Mac. This is an illustrative choice, not a reserved combination supplied by Apple.
Apple documents running the assigned combination from any app in macOS and notes that some system combinations cannot be overridden. Test yours with another app active, then repeat the test in an app you commonly use. Run a shortcut while working on your Mac.
Do not put the folder’s pathname into the Menu title field under System Settings > Keyboard > Keyboard Shortcuts > App Shortcuts. Apple limits that feature to existing menu commands. The folder-opening task belongs in the Shortcuts workflow; assign its keys through the shortcut’s details. Create keyboard shortcuts for apps on Mac.
Diagnose a shortcut that opens nothing or the wrong folder
Use the following sequence to separate a destination problem from a keyboard problem. Change one thing at a time so you can see which layer failed.
- Run the shortcut inside Shortcuts. If this fails too, inspect the action and pathname before changing the keyboard combination.
- Check the destination in Finder. Use
Shift-Command-Gwith~/Folder Shortcut Demo/. If Finder cannot reach it, correct the folder’s location or update the script. - Read any action error. The script’s
Folder not founddiagnostic means its directory check failed. A regular file with the same name also fails that check. - Try another key combination. If the run button works but the keys do not, choose an unused combination and test again. Apple documents conflicts and reserved shortcuts as limitations. Create keyboard shortcuts for apps on Mac, Run a shortcut while working on your Mac.
Account for moves, missing folders, and matching names
The script addresses a location. If you rename or move the example folder, update the target assignment. If you recreate a different folder at the original path, the shortcut will open that replacement. The directory check verifies that a folder exists there; it does not verify the folder’s identity or contents.
Two folders can have the same final name under different parent folders. The complete pathname determines which one this shortcut opens. When adapting the example, confirm the parent folders as well as the final name. For a literal absolute path, replace the assignment with your copied pathname enclosed in single quotes; that form requires additional handling if the pathname itself contains an apostrophe. Apple explains the distinction between literal single-quoted text and shell expansion in its Command Line Primer.
The opening script creates no folder and overwrites no files. If the destination is missing, it stops instead of silently creating a new empty destination. During the initial Finder setup, use an unused example name so an existing folder is never mistaken for disposable test material.
After the example works from both the run button and your chosen keys, change the destination to the local folder you actually want and repeat both tests. Keep the destination stable, retain the existence check, and use the verified key combination whenever you need that folder.
Sources
- Mac keyboard shortcuts — Apple Support.
- Go directly to a specific folder on Mac — Apple Support.
- Create a custom shortcut on Mac — Apple Support.
- Run a shortcut while working on your Mac — Apple Support.
- Meet Shortcuts for macOS — Apple Developer.
- Execute commands and run tools in Terminal on Mac — Apple Support.
- Specify files and folders in Terminal on Mac — Apple Support.
- Command Line Primer — Apple Developer.
- Advanced Privacy and security settings in Shortcuts on Mac — Apple Support.
- Understanding input types in Shortcuts on Mac — Apple Support.
- Navigate the action list in Shortcuts on Mac — Apple Support.
- Create keyboard shortcuts for apps on Mac — Apple Support.