Skip to content

Instantly share code, notes, and snippets.

@yumu19 yumu19/capture.sh
Last active Jan 27, 2016

Embed
What would you like to do?
Automatically Capture of Screenshots for Mac
#!/bin/bash
INTERVAL=60 #Interval of Capture Screen(seconds)
DIRNAME="${HOME}/Desktop/capture/"
if [ ! -e ${DIRNAME} ]; then
mkdir ${DIRNAME}
fi
while true
do
DATE=`date +%Y%m%d_%H%M%S`
FILENAME0="${DIRNAME}${DATE}_00.png"
FILENAME1="${DIRNAME}${DATE}_01.png"
FILENAME2="${DIRNAME}${DATE}_02.png"
screencapture ${FILENAME0} ${FILENAME1} ${FILENAME2}
echo "capture at ${DATE}"
sleep $INTERVAL
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.