Enhancement to Template script "Reference (from Bookends)"

I prefer to record all of my notes for scientific literature PDFs in DevonThink.

I enhanced the “script” file associated with the New from Template when grabbing reference info from Bookends. This addition stores the URL of the newly created DT item in the “user1” field of the source reference in Bookends. The hot URL is visible in the All Fields sidebar in Bookends, a quick route to my notes page if I’m browsing in Bookends.

Data > New from Template > Education > Reference (from Bookends)

code snippet with some context:

tell application id “DNtp”
– Import the RTF template
set theRecord to import theTemplateFile to current group placeholders {|%citationAuthor%|:theAuthors, |%citationTitle%|:theTitle, |%citationYear%|:theYear, |%citationAbstract%|:theAbstract, |%keywords%|:theKeywordString, |%note%|:theNotes}

-- start custom code

set dtURL to (reference URL of theRecord)
tell application "Bookends"
	«event ToySSFLD» theID given «class FLDN»:"user1", string:dtURL
end tell

-- end custom code

set prevTIDs to AppleScript's text item delimiters
set AppleScript's text item delimiters to ";"

Very nice. Thanks for sharing!