Last active
December 14, 2015 14:29
-
-
Save alfredodeza/5101166 to your computer and use it in GitHub Desktop.
Create a set of PNG's to create a GIF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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