Search for x-devonthink-item link not working

In the the Markdown you’d have:
[Big Company](x-DEVONthink-item://12345...).

Only Big Company is shown when using the preview mode, i.e., the rendered view, so that is what is searchable not the underlying link.

Thank you @cgrunenberg and @BLUEFROG

You’re welcome.

Greetings. Are you and @cgrunenberg referring to markdown files within the database or outside/indexed ones? In the document search in the inspectors pane, I can find x-devonthink-item://… urls. But in the toolbar general search, no x-devonthink-item://… urls are identified. I ran into this problem following a Apple script to find incoming item links included in Dini’s Taking Smart Notes with DEVONthink.

Would be thankful for a clarification…

At the time the script was written DEVONthink used to index the markdown source. Unfortunately this changed some months later.

Thank you @pete31. Does that mean effectively there is no longer a way to distinguish between item links and wikilinks in searching for back links?

I don’t use WikiLinks, so I can’t say anything about that.

However finding incoming links for reference url links still works if you use the reference url in the visible part of the link, e.g.



[Record Name x-devonthink-item://4D715CAE-361C-490C-839B-DBC29E6B920F](x-devonthink-item://4D715CAE-361C-490C-839B-DBC29E6B920F)

Thanks for the help. Sorry. Could you explain to me what you mean by “in the visible part of the link”. I see the examples but still don’t understand. For instance, how would the script above have to be re-written to have it work along these lines…?

If you use the reference url also in the “name” part of the link (= the part that is visible in rendered view) the script should work.

It seems DEVONthink only ignores a x-devonthink-item:// string for a record’s index when it is in the “address” part of a link, so using it also in the “name” part makes it searchable again.

This was actually requested to improve the search results & concordance.

Thanks for the info @cgrunenberg. Could you indicate how the inclusion of x-devonthink-item://… urls in the search parameters encumbered the search results and concordances and consequently what benefit is gained by removing it?

The UUIDs of such links created lots of useless bloat in the Concordance & search index and depending on the query and the UUIDs, this could cause useless results too. But searching for item links won’t be necessary soon anymore probably :slight_smile:


Wow! Sounds promising. Thanks @cgrunenberg! Any chance you could explain a little more in what direction things might be going in this regard (of course, without any liability, purely on the hypothetical!)? I am setting up my notes system and am very interested in the back link search capabilities. I am trying to decide if, when and how to use item links? A bit of foresight into what “might” be coming could shape my decisions considerably…

Clear as day now @pete31. Sorry I am new to all of this. The workaround is clear, but aesthetically painful. Having to see that full url in the rendered version every time one wants to use an item link and be able to subsequently find it in a search, is a hard pill to swallow. I suppose that is the method you have adopted, as you said you don’t use wikilinks…? And hey, thanks for so generously offering those scripts included in Dini’s book. I see now that you the origen of those scripts.

The Documents > Links inspector will show incoming links too. Sounds like a minor change but needs a lot of invisible work and background processing.

1 Like

Awesome! Are you foreseeing that one could distinguish between item links and wikilinks in what shows up there as incoming links.

Only item links will be supported, Wiki links are way too flexible to support this.

Ok. Thank you for all the help. So regarding item links, we’ll have the best of both worlds - being able to see incoming links without having to write out the full x-devonthink-item://… urls in the name part of the link while keeping the Concordance & search index free of useless bloat. For coming up with incoming wikilinks we can still revert to the @pete31’s script to find incoming wikilinks in markdown notes.

I think you mean @Bernardo_V‘s Return links/Back links script.

Ahh… thanks for the correction. :v: @Bernardo_V and many thanks for the script.