Skip to content

Instantly share code, notes, and snippets.

@jclem
Last active December 12, 2015 07:29
Show Gist options
  • Save jclem/4737458 to your computer and use it in GitHub Desktop.
Save jclem/4737458 to your computer and use it in GitHub Desktop.
Shell script for starting the Gifify process from Alfred
name=gifify_`date +%s`
echo -ne $name | pbcopy
osascript <<EOF
tell application "System Events"
set visible of process "Terminal" to false
end tell
tell application "QuickTime Player"
activate
new screen recording
tell application "System Events" to key code 49
end tell
repeat
tell application "System Events"
if "QuickTime Player" is not in (name of application processes) then exit repeat
end tell
end repeat
EOF
gifify -o $HOME/Desktop/$name -u $HOME/Desktop/$name.mov
echo 'Breaks without this.'
growlnotify -t gifify -m "Upload complete"
killall Terminal
@jclem
Copy link
Author

jclem commented Feb 8, 2013

Don't use this if you ever open Terminal.app for any other reason. This assumes that you have Alfred configured to use Terminal.app as its default application for running shell scripts, and kills the process at the end.

  1. Run the command (I have it set to run with gif in Alfred).
  2. Select the area of the screen to record, and start recording.
  3. Stop the recording, and quit Quicktime.
  4. When prompted to save, CMD+V to paste the filename the script expects (it's been copied for you).

You'll see a growl notification when its complete, and your clipboard will have a CloudApp URL in it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment