Configuring Bookends Import

I am thinking about organizing my Bookends references so that field u20 (user 20) contains a link to the reference in DevonThink so I have two-way links between BE and DT. So a typical u20 field is of the form x-devonthink-item://B84B9141-EA32-4D11-901F-5DC1322D4FAC. Now to link with TB.

How could I make this appear as a clickable URL alongside the Bookends URL and the reference URL that are already there? I have modified the Bookends RIS format to include the field, so the information is in Tinderbox (it is in the main text of the Note as DT - x-devonthink-item://B84B9141-EA32-4D11-901F-5DC1322D4FAC. I needs some way to identify the information and place it is in an attribute and tell TB that the attribute is a URL.

If extra URLs cannot be created, I could uses the ReferenceURL attribute, because I do not often want to go back to that, and if I do, I can easily go via DT or BE.

(One way would be to modify the RIS format to export u20 as UR, but I do not want to do that because the RIS format is used for other purposes, such as exporting from BE to DT. I am assuming that adding things to RIS does not cause any problem, but changing something might.)

Of course, as things stand, I can get from TB to DT, going via BE, but it would seem more elegant to be able to go directly.

If you want Tinderbox to ‘known’ an attribute is a URL (e.g. so it has a clickable button in Displayed Attributes) past the information to a URL-type user attribute.

The ‘globe’ open-URL-button for URLs stored in attribute data is seen in both Displayed Attributes (if the attribute is part of the notes Displayed Attributes!) and in Get Info/attributes. Note that although Get Info is a pop-over, you can ‘tear’ it off to make a standalone window. See tear-off windows.

I don’t think Tinderbox’s auto-mapping of RIS data is user modifiable but that’s not such a big deal as if you have access to $ReferenceRIS. Not tried, but expect you could use that method to make Bookends add an extra (custom?) RIS key to the RIS payload and then at the Tinderbox use Stream parsing to find the key’s content and put it in you (user) URL-type attribute.

Does that help?

It may do, though I am not familiar with Stream Parsing, and TBref does not give an example of the type of parsing I am looking for. I want to extract the text that appears at the end of the line that begins with the characters "DT - ". I shall read further.

Thanks for your help. Everthing else is very clear. I thought TB must be versatile enough to have multiple URLs.

Examples, er yes. I’d been rather hoping that those who’d been pushing for the feature might have shared some examples, but sadly no and I’ve not had the extra time to go test/write up rather a lot of fine grained operators.Sorry! But I agree some examples would help a lot. Part of the issue is the stream parsing operators generally aren’t used alone but in conjunction with others so you have to embrace the overall method rather than try and lear the operators one at a time.

OK, let’s assume we can (check in Bookends community) add a custom ‘DV’ tag into the RIS that Bookends populates when dragging a reference. It gives us $ReferenceRIS like so:

Now we can use stream parsing in code like so:

$ReferenceRIS("Visual-Meta").skipTo("DV - ").captureLine("DvURL");

where ‘Visual-Meta’ is the reference note holding the data.

See this very quick demo I knocked up (short on time!): RIS-parse.tbx (273.9 KB)

which results in this:

HTH & hopefully we’ll get around to some better example code in due course.

If you have success with configuring the RIS at the Bookends end, on which the whole concept depends, do report back.

Don’t bother, it works! In Bookends, I opened the menu Biblio ▸ Formats Manager and scrolled the left-side list and selected RIS.fmt. now in the ‘field order’ box (scroll down) I added a new line $DV - $u20 before the end:

N.B. here I’ve only edited the format for records of type ‘Journal article’, i.e. as seen in the main UI at top right, as here:

books-2.bdb 2023-07-24 17-22-45

This tells Bookends that when using RIS for export (and if the record is of type ‘Journal article’, or any type that has no-per-type custom entry), he drag’s RIS payload with now include a ‘custom’ field marker DV - at the the end that will use the data from Bookends field ‘user20’, if there is any.

This is why I love Bookends. Yes you have to pop the hood (scary at first), but look at the cool stuff you can do. I guess I could have done this with appleScript and a lot more effort, but we don’t need to.

(Other reference managers are available, we just happen to be discussing Bookends and this solution is specific to the app).

1 Like

By the way, if you ware wondering why we use .skipto() and not .captureTo(), this is because the stream parsing works line (i.e. paragraph) by line. As ‘DV’ doesn’t start line #1 of the text, it fails. the skip allows the process to skip over all lines not starting with ‘DV’ and then we parse the rest of the line (also ignoring anything after that line).

1 Like

This is beyond the call of duty. Thank you very much. Sorry if I looked too quickly and failed to see the examples.

Yes, as you found out, modifying the RIS.fmt in BE is easy, and works, though I have yet to find whether the redundant information causes problems for any other apps. I assume not. I shall work on this assumption.

Same here. My logic is that apps that read RIS will likely not import unknown field/tag data. The DEVONthink pseudo-URLs don’t contain textual content likely to be harmful. Bear in mind too that the customisation you’ve added affects only your copy of Bookends and the custom RIS is only passed to apps where you are pasting data, and which actually use that data. I imagine that isn’t many app. But if there are others, I’d do deliberate tests with them before committing to using this method. IOW, if you do hit a problem, it’s better to find out early before you’ll feel you’re losing out by not using the method.