one-step multi-site archiving from list of URLs

It would be great to have an easy way of dropping a list of URL’s on the download manager,
or pointing it to a text file containing a list of url’s,
and having all of the associated sites downloaded and archived in one step.

Also cool would be a command to archive any sites listed in a particular database ‘sheet’

Thanks,

-k

Maybe something like:


tell application "DEVONthink Pro"
	set theSelection to the selection
	repeat with thisSelection in theSelection
		set theSelectionText to the plain text of thisSelection -- or "rich text"
		set AppleScript's text item delimiters to ASCII character 10 -- carriage return, you might need to try ASCII character 13 depending on the type of text file you're dealing with.
		set theSelectionTextItems to the text items of theSelectionText
		set AppleScript's text item delimiters to " "
		repeat with thisLine in theSelectionTextItems
			set thisURL to the first text item of the text items of thisLine
			add download thisURL with automatic
		end repeat
	end repeat
end tell

This will take the first “word” from each line of a plain text or rich text DTP record (so that you can be like “http://www.google.com/ – It’s freaking Google, okay?” and write comments out to the side in any format you wish [so long as there is a space between the URL and notes) and add it to the download queue.

In other words, you can have a file that looks like this:


www.google.com
yahoo.com
http://www.devon-technologies.com/ -- Note: try to insert a comment about DEVONthink Pro v2.0 whenever you visit the site, whether or not it's even remotely relevant.
http://www.macrumors.com/ is a wretched hive of scum and villainy.

and so on and it’ll work fine. It might toss up an error if you start a line with a non-URL.

I could have added an extra loop in there and handled files that had multiple URLs per line, but, uh, I didn’t.

Hope that helps.

Awesome! Thank you so much, kalisphoenix!

-k