automatic source reference when creating new snippets

I have a project to “fix” our product’s technical documentation.
The existing official version of the documentation is widely considered to be incomplete, inaccurate, or unclear.

Luckily there is a wealth of other formal & informal supporting documents: various sales & training material (slides, labs etc.), tech-support documents, lots of insightful emails, marketing collateral, etc.

Some of the information in these other documents is gold! But some of that information is now obsolete or superseded in other documents.

My job is to rectify it all.

DevonThink would be perfect, EXCEPT (as far as i can tell) it does not keep track of where the data in the database came from. In other words when I drag a snippet from a document into DevonThink, why can’t it also record the file/website where the snippet came from (and ideally other “Get Info” meta data, like the last modified date)?

Being able to link my snippets back to their source would be a godsend. (Assume all the sources are accessible via my Mac file system, email client or web browser)

If DevonThink kept that information, then the classification features would be even more impressive. For example i could look at a pair of contradicting snippets and track which snippet is older, I could read the original doc for context, I could see who the author was (e.g., an engineer’s comments may carry more weight than a interns), etc.

This is not the same as the Bibliographic feature so many of you users want, because this data is less formal and this data should be readily derived from the file’s “Get Info,” an email’s header info, or a web page’s meta-data.

Maybe DevonThink can do this, and I just missed it in your docs and tutorials.
Or maybe there is some other tool that can automatically capture a source reference when I create a new snippet in a database.
(If I have to do extra copy and pastes to enter the source info, forget it. It’d be too much work when I consider ALL the sources I have to scour.)

DEVONthink does use URL references (e.g. during drag-n-drop or taking plain/rich notes) provided by the source application but most applications don’t provide this information and therefore DEVONthink can’t do anything about this.

Applications explicitly supported by DEVONthink include DEVONagent, Safari, Mail, Mailsmith, Shiira, OmniWeb, Camino and NetNewsWire.

I admit my knowledge of AppleScript is a bit sketchy,
but could a AppleScript be written (that appears in the DevonThink item the Services menu) that takes the selection (or clipboard contents) from the current application, asks the current application for info about its currently open document, and appends that information to the clipboard text and then creates a new item in the DevonThink database?

It’d be complex to do it automatically. You could just do a


set theDocumentName to name of window 1

which would get the name. The best thing to do would be to get the name of the open document from the application, then query the Finder for its creation date and other information or, if it’s an HTML page, check for META tags revealing the last-modified or creation date.

Really, something like this would require very good metadata.

To do it on a case by case basis would be easy. Just copy some text and do something like this:


set theTextDialog to display dialog "Enter a name" default answer ""
set theName to text returned of theTextDialog
set theClipboard to the clipboard
tell application "DEVONthink Pro"
	create record with {type:rtf, rich text:theClipboard, name:theName}
end tell