Skip to content

Instantly share code, notes, and snippets.

@yumu19
Last active January 15, 2021 02:52
Show Gist options
  • Save yumu19/7a10b30c0abd22cc28ec to your computer and use it in GitHub Desktop.
Save yumu19/7a10b30c0abd22cc28ec to your computer and use it in GitHub Desktop.
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