Recipes
Custom actions you can paste into the actions list of your config file.
Each recipe is one entry for the "actions" list in config.jsonc. Paste it in, save, and it shows up in the menu when the selection fits. Tools that don't come with macOS are marked, with the Homebrew command to install them.
Copy a file's contents
Puts the text of a file on the clipboard, without opening it.
{
"title": "Copy Contents",
"icon": "doc.on.clipboard",
"command": "pbcopy < {file}",
"folders": false,
"maxSelection": 1,
"output": "none"
}Folder size
Shows how much space the selected folders take up. Right-click empty space to get the size of the open folder.
{
"title": "Folder Size",
"icon": "chart.bar",
"command": "du -sh {files}",
"files": false,
"folders": true,
"background": true,
"output": "show"
}Make scripts executable
{
"title": "Make Executable",
"icon": "terminal",
"command": "chmod +x {files}",
"folders": false
}Convert images to WebP
Writes a WebP file next to each image. Needs cwebp: brew install webp.
{
"title": "Convert to WebP",
"icon": "photo",
"menu": "Images",
"command": "cwebp -quiet -q 85 {file} -o {dir}/{basename}.webp",
"extensions": ["png", "jpg", "jpeg", "tif", "tiff"]
}{dir}/{basename}.webp builds the new file name from the old one: Beach Day.png becomes Beach Day.webp in the same folder.
Turn a video into a GIF
Needs ffmpeg: brew install ffmpeg. The filter builds a color palette from the video first, which makes the GIF look much better.
{
"title": "Convert to GIF",
"icon": "film",
"menu": "Video",
"command": "ffmpeg -y -loglevel error -i {file} -vf 'fps=12,scale=720:-1:flags=lanczos,split[a][b];[a]palettegen[p];[b][p]paletteuse' {dir}/{basename}.gif",
"types": ["public.movie"]
}Compare two files
Shows the differences between two selected text files in a window, in the format of diff -u. diff exits with 1 when the files differ, so the command turns that into success.
{
"title": "Compare",
"icon": "arrow.left.arrow.right",
"command": "diff -u {files} && echo 'The files are identical.' || test $? -eq 1",
"minSelection": 2,
"maxSelection": 2,
"folders": false,
"output": "show"
}A file's Git history
Shows the last 30 commits that changed the selected file, following it across renames. In the App Store version, this needs git from Homebrew, see Developer tools.
{
"title": "File History",
"icon": "clock.arrow.circlepath",
"command": "git log --oneline --follow -n 30 -- {file}",
"folders": false,
"maxSelection": 1,
"output": "show"
}Mirror a folder to the other pane
With two panes open (⌘3), copies the selected folder into the folder of the other pane and makes the copy match exactly. Files in the copy that no longer exist in the original are deleted, so the action asks first. The first line stops with a message when there is no second pane.
{
"title": "Mirror to Other Pane",
"icon": "arrow.left.and.right.square",
"command": "test -n {otherPane} || { echo 'Open a folder in the other pane first.' >&2; exit 1; }; rsync -a --delete {file}/ {otherPane}/{name}/",
"files": false,
"folders": true,
"confirm": "The copy in the other pane will match this folder. Files that exist only in the copy will be deleted."
}Start a README
Right-click empty space in a folder to create a README.md with the folder's name as its heading. "maxSelection": 0 keeps the action out of the menu when something is selected.
{
"title": "New README",
"icon": "doc.badge.plus",
"command": "test ! -e README.md || { echo 'README.md already exists.' >&2; exit 1; }; printf '# %s\\n' {name} > README.md",
"background": true,
"maxSelection": 0
}Serve a folder over HTTP
Starts a web server for the selected folder, or for the open folder when nothing is selected, in your terminal. Open http://localhost:8000 in a browser, and press Control-C in the terminal to stop it.
{
"title": "Serve on Port 8000",
"icon": "network",
"command": "python3 -m http.server 8000",
"files": false,
"background": true,
"maxSelection": 1,
"output": "terminal"
}Extract 7z and RAR archives
The built-in Archive pack extracts ZIP and TAR archives. For 7z and RAR, install 7zz with brew install sevenzip. This extracts each archive into a folder named after it.
{
"title": "Extract Here",
"icon": "archivebox",
"command": "7zz x -y {file} -o{dir}/{basename}",
"extensions": ["7z", "rar"]
}-o{dir}/{basename} shows that quoted placeholders can be glued to other text: the shell reads -o'/Users/alex/Downloads'/'photos' as the single argument -o/Users/alex/Downloads/photos.