Full Length Webpage to ScrnShots AppleScript

Posted on November 11, 2008

If you’re on a Mac and want to take full length webpage screenshots, I’ve written a little AppleScript which uses the neat little capture utility Paparazzi! and the latest version of ScrnShots Desktop.

First thing you need to do is make sure you have both Paparazzi! and ScrnShots Desktop installed. Then download the script “Take Screenshot of Safari Window” and place it in your ~/Library/Scripts folder.

Voila, you can now run the script and it will take a screenshot of the front most Safari window and place it ready to upload in ScrnShots Desktop.

For ease of use I’ve set up my scripts folder to be accessible via Quicksilver.

Here is the complete source for the AppleScript file:

set filename to (path to desktop) as string
set filename to filename & "scrnshots-desktop-script.png"

-- You could easily change this to work off any browser you want
-- Eg: Change "Safari" to "Firefox" and it should still work
tell application "Safari"
	set current_url to URL of front document
end tell

tell application "Paparazzi!"
	set image_created to false
	capture current_url
	repeat while busy
		-- do nothing...
	end repeat
	if save as PNG in filename then
		set image_created to true
	end if
	quit
end tell

tell application "ScrnShots Desktop"
	uploadFromFile filename
	activate
end tell

do shell script ("rm " & (POSIX path of file filename))

 


1 Reply to "Full Length Webpage to ScrnShots AppleScript"

  • Aaron
    August 24, 2009 (11:11 am)
    Reply

    This is exactly the kind of script I was trying to make today. I wasn’t able to do it myself because I’m only a beginner programmer and applescript isn’t exactly the easiest language to pick up, despite it’s seemingly english-like design.

    I dropped the “ScrnShots Desktop” part but the rest works great. It would be better if it used the page’s title as the filename but that’s a simple rename once it’s saved.

    Though upon my searching, I found that SafariStand’s “Export to PDF” contextual menu option is faster and better, making the text selectable & searchable while still allowing for a webpage to be converted to an image file.


Got something to say?

Some html is OK