Skip to content

Instantly share code, notes, and snippets.

@scottjg
Created January 25, 2014 21:23
Show Gist options
  • Save scottjg/8623817 to your computer and use it in GitHub Desktop.
Save scottjg/8623817 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
print "Content-type: image/png\n\n"
pid = Process.pid
#id = `/Users/hubotvoicebox/GetWindowID "Airfoil Speakers" "Airfoil Speakers" 2>/dev/null`.rstrip
id = 322
`screencapture -l#{id} /tmp/airfoil.#{pid}.png`
print `cat /tmp/airfoil.#{pid}.png`
`rm /tmp/airfoil.#{pid}.png`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment