Right-click a file or folder in the MacOS Finder.app — Save its complete path (a URI) to the clipboard to paste somewhere.
- Reference the location of something in a Word document, a Notion page, a wiki.
- Point someone to the correct folder.
- Clean and with spaces, no escape characters.
- Right-click on
Awesome novel.txt
on your Desktop. - Select
Copy File URI
from the context menu.- at the very bottom
- or inside the
Quick Actions
- Press
⌘ V
to paste/Mac HD/Desktop/Awesome novel.txt
.
- Download the
Copy File URI
service from theReleases
to your home’s library (~/Library/Services/
).- It's nothing fancy, just a folder with some XML and a Bash script.
- Download the Bash script.
- Open Automator:
- Launch Automator, found in your Applications folder.
- Select a
New Document
:- Choose to create a new document.
- Choose
Service
orQuick Action
:- Depending on your macOS version, create a
Service
(older versions) or aQuick Action
(newer versions).
- Depending on your macOS version, create a
- Service Receives Selected:
- Set the service to
pass-through
selectedfiles or folders
inFinder
.
- Set the service to
- Add Run Shell Script:
- Drag the
Run Shell Script
action from the library to the workflow area. - Set
Pass input
toas arguments
.
- Drag the
- Copy-paste and modify the Bash script.
- it contains inline comments for all the logic
Note: No Finder.app
relaunching is required.