Skip to content

Instantly share code, notes, and snippets.

@rasshofer
Created January 8, 2015 07:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rasshofer/a3e5614db5aa2b4853fa to your computer and use it in GitHub Desktop.
Save rasshofer/a3e5614db5aa2b4853fa to your computer and use it in GitHub Desktop.
OS X: Take a screenshot, upload the screenshot to PicPig and copy the URL to your clipboard
#!/bin/bash
API_KEY="abc123"
API="https://picpig.com/api/$API_KEY"
FILE="screencapture-`date +%s`.png"
# Capture screen interactively by selection or window
screencapture -i $FILE
# Capture the main monitor
screencapture -m $FILE
curl -fsk -F "image=@$FILE" $API | pbcopy
rm $FILE
@rasshofer
Copy link
Author

If you’re using Alfred, you may create a custom workflow and assign custom hotkeys (e.g. + + 3 to capture the main screen and + + 4 to capture a selection or window interactively) that execute the scripts above. This makes the whole process invisible and perfect for daily use.

You can find your personal API key at https://picpig.com/api.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment