This started because I wanted to be able to paste screenshots or pictures copied from Safari into Finder folders. Here are the steps to get to where I am:
Install pngpaste using
brew install pngpaste.
Make Automator Quick Action, and configure as:
osascript -e 'set formattedDate to (do shell script "date +'%Y-%m-%dat%H-%M-%S%p'")' -e 'tell application "Finder" to set thePath to the quoted form of (POSIX path of (insertion location as alias) & formattedDate & ".png")' -e 'if ((clipboard info) as string) contains TIFF picture then do shell script "/usr/local/bin/pngpaste " & thePath' -e 'if ((clipboard info) as string) does not contain TIFF picture then tell application "System Events" to keystroke "v" using control down'
- Save and close.
- Remap default paste:
- Assign default paste to trigger service: