Bookends → Tinderbox, importing file:/// path to attachments

Scope: this is specifically about the Bookends reference manager. It relates to local paths to a record’s attachment(s). If attachments are managed via DEVONthink a different approach (via the latter app) is likely better

Issue: getting the local file path of a Bookends’ records file attachment(s). Most often, this is a PDF, stored locally.


When a Bookends record is Cmd+Opt+dragged to Tinderbox a fair amount off info comes along. That data gives a link to the Bookends record (via a pseudo-protocol link) and a link to the source. However, the source URL may be (for me, is) the listing of the source and not the document itself. So to ‘just’ see the referenced paper it can take several steps and often a login (so additional trip to a password manager, etc.).

I checked and the ‘base’ block of data that is passed from Bookends and that arrives as $ReferenceRIS doesn’t include path attachments. But it could. It turns out Bookends’ Format Manager does have a code for attachment path(s)I believe it is a list if >1 attachment for the record. RIS includes a number of custom fields with no formal mapping as C1C8 and U1U15. I already customise the RIS format by using C8 to pass the (BibTeX) citekey. I’ve now added U5 like so:

The result, in the passed RIS is:

Format: 'RIS.fmt' 2025-02-25 10-15-48

Don’t forget to customise all the per-record-type settings (the Bookends default RIS.fmt has 4):

Note: if you don’t use eBooks, you might consider omitting the ‘Book’ type as likely the attachment points to a placeholder image of the paper books cover. YMMV, but I figure it’s easier to have the path regardless as by eye I can tell if the linked file isn’t an image vs. a document (PDF, etc.).

Now, when a Bookends record is dragged into Tinderbox you can parse $ReferenceRIS to get the value of the U5 field in the RIS. This gives you a local POSIX path you can store in a File-type attribute (added to your Displayed Attributes?) to give easy access from in Tinderbox to the article associated with the source.

HTH :slight_smile:

5 Likes

If, as I have, you add to your TBX a File-type user attribute called ReferenceLocalFile, then the Bookends (customisation above) attachment can be visualised in your TBX. First add ReferenceLocalFile to the Displayed Attributes of the built-in ‘References’ prototype. Then use this stamp on notes of references dragged from Bookends:

$ReferenceRIS.skipTo("U5  - ").captureLine("ReferenceLocalFile");

No action code expression left side is needed as the stamped note’s ReferenceRIS data is read and from that the note’s ReferenceLocalFile is populated using stream processing techniques.

For example:

Clicking the indicated Displayed Attributes icon opens the PDF of the “NoteCards in a Nutshell” paper. I could use the ReferenceURL to get the same file, but the local copy avoids logins, cookie-walls, etc. So, if you have the document locally, I regard this is a faster/simpler access method.

Note: be aware that whilst Bookends stores an OS alias to local attachments, the alias path as at time of dragging the record to Tinderbox is what is stored in the TBX. If the Bookends record’s linked asset is moved in the OS (e.g. when tidying up one’s h/d) the alias is updated but not any previously exported path. This shouldn’t matter, but if you’ve re-organised attachments and links in Tinderbox via the method now fail, that is the most likely reason.

I overlooked, you’ll need to trim the ‘file://’ from the front of the file:///Users/mwra/Dropbox/... oath. In my case I want /Users/mwra/Dropbox/... or ~/Dropbox/....

Of course for your data the adjustment will vary depending on where you store data. If you use multiple locations, you’d do better to remove the initial file:// as hen you have a full POSIX path from root so this should work of mounted external dives as well as you main h/d.

Doh! Even simpler, make the user attribute a URL-type not a File-type. Then no adjustment of URL data to get POSIX path is needed. :roll_eyes: