Create Web Archives (Download Web Page) from a List of URLs

Hey Mykola,

Yes – but it is no easy task.

I've been fiddling with this on and off for months, and I finally have a version that works with Keyboard Maestro.

Feed the macro a list of URLs and a destination folder path, and it will create a WebArchive file for each URL at the given destination.

Many thanks to Shane Stanley for his help with this.

-Chris


Create WebArchives from a List of Remote URLs v1.01.kmmacros (9.8 KB)

8 Likes

A question:

How does one catch the url - by selecting or save link? (if it is just 1 url) for example when I find a page through a search engine?

/
with best regards,
Omar KN
Stockholm, Sweden

It looks like all you have to do is copy the URL from the browser address bar and paste it into the URLs to Download value field (the first yellow step).

Thank you,

Did that, and set the download folder path,

but nothing happens.

KM Debug doesn’t activate.

/
with best regards,
Omar KN
Stockholm, Sweden

Hey Omar,

Pariah is exactly right. That's why I created the macro this way, so the user could change the method used to get the URL(s) to be saved.

urlList could be acquired by getting the Safari URL for instance:

That doesn't help me debug anything.

Please post a URL that fails, and I'll look into the whys and wherefores of it.

Why would it? The Keyboard Maestro debugger doesn't operate at all unless you turn it on manually (or the macro does).

Perhaps you meant the script doesn't throw an error? (Which is entirely separate from KM's debugger.)

I'll replace the original macro with v1.01 here in a minute. The new version will have an error-handler, but that doesn't mean it will report your specific problem. I'll still need to see a failing URL.

-Chris

Work for me!

Thnx for sharing.

1 Like

Hi and good day Chris,

There must be some miss on my part, because I can’t even get the macro to start.

I set the Safari url (=SU) action for testing.

If you can have a look:

/
with best regards,
Omar KN
Stockholm, Sweden

Create SU WebArchives from a List of Remote URLs SafURL.kmmacros (9.42 KB)

Hey Omar,

I'm not sure what's up.

The first time I tried your macro it didn't work.

Then I turned on the set variable urlList to %SafariURL% action and turned OFF directly setting variable urlList to theguardian.com URL.

Still didn't work.

Then I toggled the group and the macro on/off a couple of times, and the macro started working.

I really need to do something to make the file-naming process a little more robust, but so far everything I've tried to download works.

Keep in mind that when you use %SafariURL% that Safari must NOT have been hidden with the menu items “Hide Safari” or “Hide Others”

This can be guarded against by something like:

tell application "System Events"
   tell application process "Safari"
      if its visible is false then set its visible to true
   end tell
end tell

I'll have to think over the improvements I want to make to macro. At least one will take some research to figure out.

-Chris