When working in Finder, you often need to copy the full path of a file to the clipboard. Using the built-in Automator on macOS, you can create a Quick Action that lets you do this with a single right-click.
Open Spotlight (⌘ + Space), type "Automator", and launch it.
Select "New Document" → "Quick Action".
Double-click "Run Shell Script" from the action list on the left, then configure:
export LANG=ja_JP.UTF-8
for f in "$@"
do
echo -n "$f" | pbcopy
done
Note: The export LANG=ja_JP.UTF-8 line is needed to prevent garbled characters in non-ASCII file names. Automator's shell environment doesn't have locale settings enabled by default.
Save with ⌘ + S. Name it something like "Copy Full Path".
The workflow is saved as a .workflow file in ~/Library/Services/.
Select a file in Finder → Right-click → Find it under "Quick Actions".
Note: Since macOS Monterey, the "Services" menu has been consolidated into "Quick Actions".
If the action doesn't appear:
killall FinderReplace the script with:
export LANG=ja_JP.UTF-8
printf '%s\n' "$@" | pbcopy
This copies the paths of all selected files, separated by newlines.