Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
pbpaste.workflow
# Open "Automator.app", add a new "Quick Action"
# Workflow receives current "files or folders" in "Finder"
#+ Run Shell Script
#+ Shell: /bin/bash
#+ Pass input: as arguments
# Deployment: Keyboard / Shortcuts, bind 'Cmd-Shift-V'
# Usage: copy something to clipboard, click on a folder, press 'Cmd-Shift-V'.
# Contents will be pasted into 'pbpaste.txt'.
# Should a 'pbpaste.txt' exists, new contents will be appended with dashes.
export LANG=en_US.UTF-8
if [[ -d "$@" ]]; then
cd "$@"
if [ -f pbpaste.txt ]; then
echo >> pbpaste.txt
echo "--------------------" >> pbpaste.txt
echo >> pbpaste.txt
fi
pbpaste >> pbpaste.txt
elif [[ -f "$@" ]]; then
echo >> "$@"
echo >> "$@"
echo "--------------------" >> "$@"
echo >> "$@"
pbpaste >> "$@"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment