Skip to content

Instantly share code, notes, and snippets.

@alfredodeza
Last active December 14, 2015 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alfredodeza/5101166 to your computer and use it in GitHub Desktop.
Save alfredodeza/5101166 to your computer and use it in GitHub Desktop.
Create a set of PNG's to create a GIF
#!/bin/bash
set -e
app=$1
if [ $2 ]; then
window=$2
else
window=1
fi
window_id=$(osascript -e "tell app \"$app\" to id of window $window")
echo "Starting screen capturing with these settings..."
echo "App: $app"
echo "Window Number $window"
echo "Window ID $window_id"
echo "Ctrl-C to exit, or wait to continue"
sleep 4
for i in {1..9999}; do
echo “taking screen shot $i”;
screencapture -o -l $window_id -x ~/Movies/gifs/$app_$i.png;
sleep 0.2;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment