Devonthink and Bike

I use Devonthink last version (4.4.2); are the Bike row attributes readable/useful in it?

CSS referencing particular data- attributes could be used to specialise the appearance of some rows in DEVONthink, but DEVONthink doesn’t have the capacity to index, search, or read custom attributes.

Probably not impossible to write some code to parse the .bike files and write attribute key:value pairs to DEVONthink tags or metadata fields, but there’s nothing there that will work out of the box, I think.

and a previous conversion of row attributes to some sort of tags readable by DT?

I think DEVONthink can read plain #tags but that still doesn’t give you a key:value pairing.

Even if you were to write a script to bring key:value pairs from the data- attributes into the <p> text, you would still have to write DEVONthink Smart Rules, triggered on import events, which used the Scan Text action, defining regular expression patterns to parse your key:value data.

Again, not impossible, but nothing that works out of the box, and a fair amount of work to get it right.

and as of today what relationships between Bike and DT you can imagine… out of the box?

what relationships between Bike and DT you can imagine

That, of course, would depend on the work-flow problem(s) you were trying to solve by using those tools in conjunction.

( My impression is that DEVONthink metadata attaches more to particular records (i.e. whole documents) than to specific lines within those documents )


Generally though, since DEVONthink lets you view imported .bike files in two modes – source and preview, you can certainly do text searches for patterns like data-flagged

PS still not quite sure what specific workflow problem(s) you need to solve, but simply in terms of architecture, for:

  • atomic DEVONthink notes,
  • linking to particular rows in a Bike outline in your DEVONthink database,
  • and flagged with one or more tags or key:value metadata

you can:

  1. create small Markdown notes in a DEVONthink folder,
  2. paste Bike row links into those MD notes, and
  3. attach DEVONthink metadata to each such MD note.

thanks, you’re always kind and useful!
How one can " …flag with one or more tags or key:value metadata"; in other words how can a DT tag be translated into a “key:value metadata”?

To represent a key:value pair in DEVONthink you need to use custom metadata, rather than tags.

In JavaScript terms for example (taken from the add custom metadata entry in the DT scripting dictionary):

(() => {
    const theApp = Application("DEVONthink");
    const theRecords = theApp.selectedRecords();
    const theDate = new Date();
    
    theRecords.forEach(r => {
        theApp.addCustomMetaData("Me", { for: 'author', to: r });
        theApp.addCustomMetaData(theDate, { for: 'date', to: r });
        theApp.addCustomMetaData(3.14, { for: 'price', to: r });
    })
})();

One could write a script to add a small Markdown note,
to the current group in DEVONthink,
(with Bike-derived metadata, and a link back to the corresponding Bike row)
for each row in the front Bike outline that has data- attributes
(or data- attributes of a particular kind)

but perhaps, on reflection, the best way (and most out of the box) way to work Bike ⇄ DEVONthink is to use the Bike Markdown format, as in any of:

  • Bike > Settings > Document > New Document > Markdown Text Format
  • Bike > File > Save As ... > Markdown Text
  • Bike > Edit > Copy > Copy Markdown Text
  1. DEVONthink generally has good support for the Markdown document type
  2. As Markdown Text, Bike row attributes are visible in the {flagged=green} format, and so fully searchable and fully indexed.