Bookends template

Okay, bumping again. Any updates on this issue? A couple of us provided example references, but there’s no indication if they were received or the underlying problem identified.

I have received the references but as I was focused on bringing the iPhone project to alpha 3 stage before Christmas I did not look at them right now. I will give all template scripts a closer look after the Christmas holidays.

Eric: Thanks for the update! It’s good to know the information got to you. I look forward to the template update whenever you’re able to get around to it.

Hello! Sorry to bring this up again, but is there any news regarding this issue?

Thanks

S

Erich, please, help us :frowning:

Please try this updated template with updated localization. Does it fix any the issues? If not, please write back which version of Bookends you’re using.

Reference (from Bookends).templatescriptd.zip (55.9 KB)

still not working for me… please see attached screenshot.

Devonthink Pro Office 2 Beta 8
Bookends 10.6.4
devon_be.png

This is definitely an error from the old template. Please replace the older Bookends template in ~/Library/Application Support/DEVONthink Pro 2/Templates.noindex with the new one; then try again.

I tried it again, just a minute ago. Still this failure message from above.

I unzipped the new template script, closed DT, deleted old/copied new template script in/to:
user/library/application support/devonthink pro 2/Templates.noindex/Education, started DT and Bookends and tried it again.

The new version of the templatescript works for me only if after selecting a reference in Bookends (10.6.4) I type the keyboard shortcut “⌘C”. Otherwise DT copies whatever happens to be on the clipboard. Is it not possible to have a script which would make this “⌘C” unnecessary?

It would be useful if the script would also copy Keywords from Bookends.

ditto here.

OK, bug found — one single letter, as always. Apologies! Please try this one now:

Reference (from Bookends).templatescriptd.zip (55.9 KB)

Still no joy, Now getting error: “Please activate again with a Bookends main window being Bookends; front window”.
The problem is solved if I name my Bookends database “Bookends”, which I obviously prefer not to do, especially when I have several databases.

I tried to use the templatescript with a BE-Database named “Bookends” - indeed, the script is working now.

It works perfectly. Thank you very much indeed!
I wondered, though, and I’m very sorry to bother you once again, how I could customise it to copy an additional field from the reference, the ‘Notes’ section. I understand how to change the template rtf itself so that it has somewhere to paste it, but not whether it is possible to tell the script itself to copy an additional field.

Thank you once again!

S

Nevermind. I’ve worked it out. I created a custom template in Bookends which works with cmd-K, and amended the script accordingly (to use keystroke “K” rather than “c”). Then I adapted the rest of the script to recognise the fields that I needed, and the rtf file to set the placeholders where I wanted them to go. Works beautifully.

Thanks again, Eric!

Yes, the window needs to be named “Bookends” because Bookends itself is not scriptable at all. I access all elements by faking user interaction and the only way to know that the right window is frontmost is to check its name.

Please feel free to contact the Bookends team and ask for proper AppleScript support. As soon as they add it we’ll use it :slight_smile:

Hi,
very interested in your ‘way’, could you share?

Another more general question to all:
I’m managing to import all my BE database in DT creating an rtf bibliography, then slitting the rtf, batch tagging each reference according to BE keywords.
This approach has some pros (to have each reference tagged also in DT) and cons (bookends template has a back link and it’s visually better).
The question is: will it ever be possible to batch process references in BE and have them in BE template in DT? (I think it’s hard as GUI scripting is needed but I’m not an expert) :confused:

Of course! Eric’s script works by copying a reference by using command-c. I changed it so that it uses command-k, which of course copies the reference selected in bookends in a particular format.

Cmd-c copies a citation which contains that looks something like this:

'author -> year -> title -> -> -> -> -> -> -> bookends id -> -> ’ (fields are separated by tab spaces, which I have represented as arrows, and some of them are empty.)

The script is then designed to recognise the first, second, third and ninth items in the citation. By changing it to press command-k, you can make it copy whatever fields you want it to by creating your own bookends export format, as long as the items in it are separated by ‘tab’ spaces (or whatever you set in the script). So, for example, you might want to create a custom bookends format that not only includes the four fields in the original script, but also, say, the ‘notes’ field. So the format in bookends might look something like,

‘a∆d∆t∆@∆n’
(where a = author, d = date, t = title and n= notes, @ = bookends ID and ∆ = tab.)

And it would be exported as,
‘author -> date -> title -> bookends ID -> notes’

Then you change the script to grab all five fields, and change the rtf template to include the fields that you need, and arrange them however you want them.

I found this particularly useful in my work as an historian. Some time ago, I created a custom reference type in bookends for documentary sources, because I was sick of having to write these in by hand. It also allowed me to transcribe the sources directly into the ‘notes’ field. For example, one of my custom reference types is for royal correspondence in the General Archive of the Indies. It includes fields for days and months, the location where a particular letter or bit of legislation was written, a title, the archival reference, etc., and of course the transcribed text itself.

But I wanted to take advantage of DT’s superior search capabilities, and so I wanted a way to export these references in a way that included all the information that I needed to catalogue them in DT, as well as the text itself that I wanted DT to be able to search. I first tried to do this by creating a really long custom bookends format that I could feed into DT by copying to the clipboard with cmd-k, and then pasting it into DT. But this was cumbersome and didn’t really let me switch back and forth between the two applications very easily. I didn’t think of the method that you described, but I think this script might be a lot quicker, and – like you – I really like the link that it generates that switches back to Bookends and finds the relevant reference with a click.

As for automating it to export a batch of references, the best I could think of with my very limited experience with this sort of thing was to change the script slightly and create a keyboard shortcut for the script through keyboard preferences (I used F1). I modified it to close the window after saving the new file, switch back to Bookends, press the ‘arrow down’ key (‘key code 125’) to move to the next reference, and finally switch back to DT. So first you create a group with the references you want, select the first one, press the shortcut key, let the script do its magic (now including selecting the next reference on the list and returning to DT), press the shortcut key again, etc.

I’m sure there is probably some way of automating it to run the script a certain number of times, or something like that, but this is beyond my abilities, and I have to say that this was quick enough for my purposes.

I hope this helps!

Thanks a lot Smithsmoth!
This is quite an almost automated way of integration. (Could you share the code?)
Maybe someone at DT could help with a last point: I had made some similar attempts to modify the script template to add the keywords but I think the keywords field in the view that the script uses only shows (i.e.: gives the option to copy to clipboard) the first keyword which is the data I’m interested in. Any idea?
Nestor