Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Bulk convert Safari's Web Archives to PDFs Web Browsers
I've been archiving web pages using Safari's one-file web archive format for a while. I was trying to figure out a bulk conversion method if I want to send these archives to Windows users, or switch to a different browser. It turns out that Scott Garner's Download URL as PDF Automator action can take web archive files from the Finder and will convert them to PDFs (in addition to its intended function of downloading pages off the web.)

Just download the Automator action, then create a workflow with Find Finder Items hunting through your home directory for files that have the extension webarchive. That action should feed into Scott's action, and you're all set. The action has some options, including whether or not the PDF should be split into pages.
    •    
  • Currently 2.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (9 votes cast)
 
[20,785 views]  

Bulk convert Safari's Web Archives to PDFs | 6 comments | Create New Account
Click here to return to the 'Bulk convert Safari's Web Archives to PDFs' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Bulk convert Safari's Web Archives to PDFs
Authored by: Sesquipedalian on Jun 15, '09 12:51:14PM

Was this tried using Safari 4? Because as of today (June 15, 2009), the current version of the Automator action doesn't work properly. It just spits out blank PDFs.



[ Reply to This | # ]
Bulk convert Safari's Web Archives to PDFs
Authored by: paul h on Jun 19, '09 10:42:09AM

The whole thing is a mystery to me. I downloaded and installed something, but find finder items does not find anything of type webarchive.



[ Reply to This | # ]
Bulk convert Safari's Web Archives to PDFs
Authored by: paul h on Jun 19, '09 10:45:52AM

oops. sorry. what I mean to write is the results of find finder files for the webarchives don't seem to "feed into" whatever I installed.



[ Reply to This | # ]
Bulk convert Safari's Web Archives to PDFs
Authored by: ddesmons on Sep 19, '09 10:22:48PM

This generates a PDF file but when trying to open it, I get the message: "Couldn't open the file. It may be corrupt or a file format that Preview doesn't recognize."
Any other way to download URLs to PDF or convert webarchives to PDF?



[ Reply to This | # ]
Bulk convert Safari's Web Archives to PDFs
Authored by: Forrmann on Sep 27, '09 07:49:24AM
Thank you for useful information. Good job!

Software Mega Lib

[ Reply to This | # ]
Bulk convert Safari's Web Archives to PDFs
Authored by: mr. applescript on Jan 04, '10 05:02:23PM
Here's a script that I use as the source for a Run AppleScript action that follows a Get Specified URLs action to print various webpages to PDF in Preview:
on run {input, parameters}
  
  if my GUIScripting_status() is false then error number -128
  
  repeat with i from 1 to the count of input
    set this_URL to (item i of input) as string
    
    tell application "Safari"
      activate
      make new document with properties {URL:this_URL}
      delay 3
    end tell
    tell application "System Events"
      tell process "Safari"
        keystroke "p" using command down
        repeat until (exists sheet 1 of window 1)
          delay 1
        end repeat
        click menu button "PDF" of sheet 1 of window 1
        delay 1
        tell menu 1 of menu button "PDF" of sheet 1 of window 1
          click menu item "Open PDF in Preview"
        end tell
      end tell
    end tell
    delay 2
    tell application "Safari"
      activate
      close document 1 saving no
    end tell
    
  end repeat
  
  return input
end run

on GUIScripting_status()
  -- check to see if assistive devices is enabled
  tell application "System Events"
    set UI_enabled to UI elements enabled
  end tell
  if UI_enabled is false then
    run script "tell application \"System Preferences\"
      activate
      set current pane to pane id \"com.apple.preference.universalaccess\"
      display dialog \"This script utilizes the built-in Graphic User Interface Scripting architecture of Mac OS X which is currently disabled.\" & return & return & \"You can activate GUI Scripting by selecting the checkbox “Enable access for assistive devices” in the Universal Access preference pane.\" with icon 1 buttons {\"Cancel\"} default button 1
    end tell"
    return false
  else
    return true
  end if
end GUIScripting_status
robg adds: Edited for layout to narrow the page display
Edited on Feb 19, '10 10:39:52AM by robg


[ Reply to This | # ]