Retaining & Exporting URLS with clippings

I’m hoping somebody might know how to configure Devonthink or write a script that would include the url’s of clippings I am making from the web so that I can print or export them for further processing. I’d like to do on my Powerbook what I have been doing on Windows using Zoot for years: clip articles from newspapers, export them into a txt file, import the file in Word, and run a couple of macros that move the url below the title, put the title in H1, the text in H4, format the whole business in two columns, create a table of contents with the titles, and presto! a newspaper with urls for every article. I’d greatly appreciate learning that someone has figured this out, or at least, who might outline the strategy I might use to write my own script. Thanks! Bruce

You could use a script like the following one:


tell application "DEVONthink Pro"
	set theSelection to the selection
	if (count of theSelection) is 1 then
		set theURL to URL of item 1 of theSelection
		if theURL is not "" then
			tell text of think window 1
				make new paragraph with data (theURL & return & return) at beginning
			end tell
			tell think window 1 to save without asking
		end if
	end if
end tell

Note: This script requires a visible & editable plain/rich text document in the frontmost window.

Hi Christian! MANY thanks! I’ll try it! All the best, Bruce

It works beautifully, Christian, thanks so much. Now my question is (begging for assistance): how can I script this to perform this operation on every file in a group. I’m new to this scripting business, am not finding relevant examples readily but am looking. If there is a quick solution close at hand I’ll very much appreciate learning about it! Thanks! Bruce

Switch to vertical or horizontal split view, select all rich text contents of the group and then use this script:


tell application "DEVONthink Pro"
	set theWindow to think window 1
	copy the selection of theWindow to theSelection
	repeat with theRecord in theSelection
		set theURL to URL of theRecord
		if theURL is not "" then
			set the selection of theWindow to {theRecord}
			delay 1
			tell text of theWindow
				make new paragraph with data (theURL & return & return) at beginning
			end tell
			tell theWindow to save without asking
		end if
	end repeat
end tell

Warning: This script will fail if you’re not using the recommended views or if the selection does contain non rich text contents.

Thanks, Christian! This script works just fine! It really does go through each file, insert the url, and leave me with files I can then merge, export, and then process in Word with macros as I had hoped. MANY thanks! Bruce

I’m having trouble submitting this request: twice now I thought I hit “submit” but received a “save to drafts” message and I can’t find my drafts in this interface.

I’m trying to export a group of 30 urls, urls alone, so I might eventually share a list of them in html format, with the name as it appears in devon on top and html links below. So far, I can export text files, but the only export of urls I have found that works is opml. I don’t know what to do with opml. Is there a way to export urls into a format that I can work with, or is opml the way to go (in which case I’ll appreciate advice on what app might read opml and help me convert to html).

Thanks!

Bruce

You might have a look at the script posted in this thread:
http://www.devon-technologies.com/scripts/userforum/viewtopic.php?f=2&t=7535