Created
February 12, 2015 00:53
-
-
Save atduskgreg/57e942ed3c5f4d062da3 to your computer and use it in GitHub Desktop.
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
# 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` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice! It looks like current versions of OS X support simply using
screencapture
to grab screenshots.