Last active
September 13, 2021 04:19
-
-
Save scateu/6ceb04c2f107924d58374bb962cdcf76 to your computer and use it in GitHub Desktop.
pbpaste.workflow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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