Skip to content

Instantly share code, notes, and snippets.

@atduskgreg
Created February 12, 2015 00:53
Show Gist options
  • Save atduskgreg/57e942ed3c5f4d062da3 to your computer and use it in GitHub Desktop.
Save atduskgreg/57e942ed3c5f4d062da3 to your computer and use it in GitHub Desktop.
# Depends on https://github.com/vorgos/QuickGrab
# Install quickgrab and make sure it's in your path
sketchname = ARGV[0]
unless sketchname
puts "\tusage: ruby capture_sketch.rb <sketch_name>"
exit 1
end
line = `ps x | grep #{sketchname}`
pid = line.split(" ").first.to_i
puts "saving #{sketchname}.png"
`quickgrab -pid #{pid} -file #{sketchname}.png`
@jbobrow
Copy link

jbobrow commented Feb 12, 2015

Nice! It looks like current versions of OS X support simply using screencapture to grab screenshots.

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