Skip to content

Instantly share code, notes, and snippets.

@ericboehs
Created July 29, 2009 15:45
Show Gist options
  • Save ericboehs/158229 to your computer and use it in GitHub Desktop.
Save ericboehs/158229 to your computer and use it in GitHub Desktop.
#!/bin/bash
## Screenshot script for Mac OS X
## Author: Eric Boehs
## URL: ericboehs.com
# Set these variables:
USERNAME=ericboehs
SERVER=ericboehs.com
DIR=\~/ericboehs.com/screenshots/
FILENAME=`date +%Y%m%d-%H%M%S`
URL=http://ericboehs.com/screenshots/$FILENAME.png
GROWLLOCATION=/usr/local/bin/growlnotify
##################################
### DO NOT EDIT BELOW THIS BOX ###
##################################
mkdir -p /tmp/screenshots
/usr/sbin/screencapture -i /tmp/screenshots/$FILENAME.png
if [ -e /tmp/screenshots/$FILENAME.png ]
then
scp /tmp/screenshots/$FILENAME.png $USERNAME@$SERVER:$DIR
echo -n $URL | pbcopy
echo -n $FILENAME.png has been uploaded to $SERVER and the URL was copied to the Clip Board. | $GROWLLOCATION -t Upload Complete -i png
#open $URL
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment