List of URLs to Single-Page PDFs _and_ web archives

Hello! First time forum-poster here :wave:

I have a file with 250+ URLs.

I would like to save each URL as a single-page PDF and a webarchive.

Originally I was looking for a generic command-line way to do this, but I cannot find a way to create a single-page PDF from an URL on the command-line. However, I know that EagleFiler can do this.

I have seen

but that seems to presume that I already have the web archives, and in this case I don’t.

So what’s the best/easiest/simplest way to automate this process? Ideally I’d like to point EagleFiler at this plain-text list of URLs (one-per-line) and have everything just sort of magically happen, but I’m brand new to EF so I’m not really sure what is possible.

(If anyone knows a non-EF way to do this, I’d love to hear that too.)

Thanks!

Welcome!

I think the easiest way would be:

  1. Open the text file, Select All, and Copy.
  2. Set EagleFiler’s Web archive format to PDF (Single Page).
  3. Choose Import URL(s)… from the File menu. Paste, and click Import.
  4. Set EagleFiler’s Web archive format to Web archive.
  5. Choose Import URL(s)… from the File menu. Paste, and click Import.

Or you could use AppleScript.

Curious… I’d love to be able to find a command-line way to send a URL and have EF get both formats.

Looks like the AppleScript-y way would be to do this:

tell application "EagleFiler"
    tell library document 1
        
        -- import URLs, creating Web archives and adding tags
        import URLs {"http://www.apple.com", "http://c-command.com"} tag names {"mac", "software"}
        
    end tell
end tell

Is there a way to specify the archive type (webarchive or single-page-PDF) in AppleScript, or do you just get whatever the preference is set to?

Yes, there is the Web page format parameter. If you don’t specify it, you get what’s set in the preferences. To do this from the command line, you could write a script like:

on run _argv
    tell application "EagleFiler"
        set _url to item 1 of _argv
        import URLs {_url} Web page format PDF single page format
        import URLs {_url} Web page format Web archive format
    end tell
end run

and save it as Import.scpt. Then to invoke it:

osascript Import.scpt https://c-command.com
1 Like

Oh, now that is very clever.

Thanks!