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:

  1.  
  2. set filename to (path to desktop) as string
  3. set filename to filename & "scrnshots-desktop-script.png"
  4.  
  5. -- You could easily change this to work off any browser you want
  6. -- Eg: Change "Safari" to "Firefox" and it should still work
  7. tell application "Safari"
  8. set current_url to URL of front document
  9. end tell
  10.  
  11. tell application "Paparazzi!"
  12. set image_created to false
  13. capture current_url
  14. repeat while busy
  15. -- do nothing...
  16. end repeat
  17. if save as PNG in filename then
  18. set image_created to true
  19. end if
  20. quit
  21. end tell
  22.  
  23. tell application "ScrnShots Desktop"
  24. uploadFromFile filename
  25. activate
  26. end tell
  27.  
  28. do shell script ("rm " & (POSIX path of file filename))
  29.  

 


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