Linking Bookends reference to DEVONthink

Hi Kyle,
Thank you so much for your work!
But I met a problem with the “create a brief” script.
When I tried to run the script, I met this error message: “Error: -1728: DEVONthink 3 got an error: Can’t get think window “bookends://sonnysoftware.com/9888”.”

I have update the devonthink record information using the script you provided in advance.

Hi Kyle, I found the reason why I can’t activate the script.
I am using dual monitors so I think I need to modify the script. Do you have some tips about this?

Put the Bookends window on the same monitor in the same space as where you’re running the script.
Does it work then?

Try replacing the lines:

open tab for URL theURL
close think window named theURL

with:

open location theURL

Sorry to raise up an older post, but I would appreciate some help. I have followed all instructions but for the second script I have an issue with the citation link populating in DEVONthink. I assume this is a setting in Bookends I have failed to setup correctly.

**Citation:** [](bookends://sonnysoftware.com/36379)

I’d be grateful for any help with my Bookends settings to get the citation filling correctly upon running the script.

Thank you for your awesome work and help in advance! :raised_hands:

It looks like you might not have anything in the user1 field in Bookends. This field is used if Bookends has been set up for Bibtex citations. If you are not using user1 then you could replace user1 in this portion of the script:

set theCitation to user1 of theRef

with some other meaningful Bookends field name

Thank you for your help! Solved :+1:

Great scripts, thank you!
Maybe I’m over-optimistic, but I’m trying to use this to transfer Keywords as well. I have exiftool, and Authors & Title are transferring perfectly. Keywords seem to be more challenging - at least for me: I have close to zero knowledge about scripting! - as I can’t parse them correctly.
Bookends seems to store them with a semi-colon delimiter, and Devonthink with a comma, but they just end up all merged, or the keywords with a space mess up the script…
Any ideas or tips on how I might be able to achieve this?

For those interested, I got it to work.
Plus, learned a whole bunch about scripting at the same time :slightly_smiling_face:

Basically added the following to get the keywords from Bookends:

	set theKeywords to keyword names of theRef
	set {TID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, ","}
	set theKeywords to theKeywords as text
	set AppleScript's text item delimiters to TID
	set theAttachments to attachments of theRef

And this to add them to the Keywords field in DT (and the PDF itself):

do shell script "/usr/local/bin/exiftool -title=" & quoted form of theTitle & " -author=" & quoted form of theAuthor & " -sep \", \" -keywords='" & theKeywords & "' -subject=" & quoted form of theJournal & " -overwrite_original " & quoted form of thePath
4 Likes