Screen capture into photoshop

Alec Jacobson

January 10, 2011

weblog/

Making figures for our upcoming submission I find my self repetitively taking screen captures of my program and then pasting them into photoshop where I can crop and arrange them. This is a lot of clicking around and switching apps and it's hard to take a sequence of shots quickly. I could make just write all the screen shots to file and load them into photoshop as a batch. But Photoshop's batch loader script is slow, so pasting is the fastest way to get all the images as layers and move on to editing. Here's a script that stays open with a prompt asking whether to take another screenshot and dump it into the current photoshop document. Replace MYAPP with the name of the app your are trying to screen capture.
repeat
	tell application "MYAPP"
		activate
		display dialog "Screen capture and paste into Photoshop?"
	end tell
	
	do shell script "screencapture -c"
	tell application "Adobe Photoshop CS5"
		activate
		tell current document
			paste
		end tell
	end tell
end repeat