Adding news from Endo to DEVONthink

Here’s a script to add the selected article from endo (a new scriptable RSS reader) to DEVONthink Pro:


tell application "endo"
	try
		try
			if exists (selected article) then
				set this_article to the (selected article)
			else
				error
			end if
		on error
			error "No article is selected."
		end try
		
		set this_title to title of this_article
		set this_note to content of this_article
		set this_when to timestamp of this_article
		set this_link to link of this_article
		set this_note to "<html><body><p><a href=\"" & this_link & "\"><bold>" & this_title & "</bold></a></p><small>" & this_note & "</small></body></html>"
		
		tell application "DEVONthink Pro" to create record with {name:this_title, type:html, date:this_when, URL:this_link, source:this_note}
	on error error_message number error_number
		if the error_number is not -128 then
			try
				display alert "Endo" message error_message as warning
			on error number error_number
				if error_number is -1708 then display dialog error_message buttons {"OK"} default button 1
			end try
		end if
	end try
end tell

This script will be part of the next release, in the meantime just save it in the folder ~/Library/Scripts/Applications/endo.

The script works well, but for some feeds, such as Yahoo, imports only a link to the article. Unless the article itself is imported the link will expire, so a second step is needed. endo appears to be quite buggy to me, repeatedly flagging old news as new and then refusing to mark it as read.

Thanks for the script.

David

You could replace…


set this_note to content of this_article 
set this_when to timestamp of this_article 
set this_link to link of this_article 
set this_note to "<html><body><p><a href=\"" & this_link & "\"><bold>" & this_title & "</bold></a></p><small>" & this_note & "</small></body></html>" 

…with…


set this_when to timestamp of this_article 
set this_link to link of this_article 
set this_note to download markup from this_link

…and DT Pro will download & store the referenced link.

Thanks. It would not compile, flagged ‘markup’ in the last line and returned:

Expected end of line, etc. but found identifier.

David

Oops… my fault :wink: It should be…

tell application “DEVONthink Pro”
set this_note to download markup from this_link
end