Created
December 17, 2012 19:55
-
-
Save fooqri/4321473 to your computer and use it in GitHub Desktop.
TextExpander snippet for saving clipboard image to disk and writing markdown link for it.
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
#!/usr/bin/env bash | |
uuid_str=$(/usr/local/bin/uuid) | |
dir="/Users/my-account/my-wiki/images/" | |
target="$dir$uuid_str.png" | |
var=$(/usr/local/bin/pngpaste $target 2>&1) | |
if [ "$var" == "No PNG data found on the clipboard!" ]; | |
then | |
echo "No-PNG" | |
else | |
echo "[![$uuid_str.png](images/$uuid_str.png)](images/$uuid_str.png)" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment