I started out wondering if there is a DevonThink url scheme for launching a search for items with a certain tag. I know I can create a smart group that filters to a tag, and I can also get the URL for a tag, but I was hoping I could add a standard URL within a master project document that creates a query for all documents with the project tag.
I found some very advanced constructions that converted into AppleScript, but I have not found any kind of comprehensive guide to the basics of url schemes in DevonThink. Please direct me to any resources that may educate me!
Is there a way to force search URLs to open a new window? I ask because I use search URLs fairly frequentlyâoften adding them to various Markdown notes that refer to certain subsets of my notesâand when I click on the search URLs, the search appears in the background.
The exact behaviour seems to be hard to pin down. If no other DT windows are open, clicking a hyperlink with a search URL in an open note (e.g. the only open window) causes a new window open, showing the search results. However, if multiple DT windows are already open, clicking on a search URLâwhile it does actually perform the search, doesnât bring the search results window the foreground.
Iâve hunted through the DT documentation but cannot find any URL parameter / âflagâ that will force search results to be shown in a new window, or activate the existing (reused) search results window.
Finally, minor but irritating is the fact that clicking on a search hyperlink causes macOS to âbeepâ (sort of a âthunkâ system sound). The ability to turn this off would be appreciated.
As a follow up, Iâve noticed that some search queries donât work on DTTG v3. From the bit of âdiggingâ that Iâve done, it seems that the kind search facet isnât supported (?) on DTTG. For example, the search query below works perfectly on macOS, but not on iOS:
tags:tech;term kind:markdown
Changing to just tags:tech;term works.
As an aside: search results display on iOS isnât as âniceâ as on macOS⌠on macOS the search results show the note icon, which I use extensively, but on iOS each search result just has a little circle; and on macOS there is a âscoreâ bar graph. Wondering if some of the macOS goodness will find its way to iOS? Similar thought/question arises around Smart Groups⌠(?)
Another question: Is there documentation somewhere that describes how to correctly URL encode search URLs? I ask because Iâve experimented a fair bit and have sort-of gotten things working, as follows:
Given a working search queryâshown in the DT search fieldâas follows âŚ
tag:tech tag:term kind:markdown name!=Tech Terms
⌠what works is a âpartially URL-encodedâ encoded query of the form:
Any chance âkindâ could/will become a supported prefix in DTTG? Or, expressed more generally, are you able to share general thoughts re DTTG vs macOS parity? (though I know that you, rightly, donât discuss product plans in public)
Try escaping the semicolon (%3B). Thatâs one of the characters that must be urlencoded. Similar to space, #, /,?,& and possibly some others. I guess Wikipedia knows all about it.
In fact, ; is an alternative to & in search strings. So in your example, youâre effectively breaking the URL.
@chrillek Thanks. I previously tried URL-encoding semicolon and the hyperlink didnât work. Further investigation shows that I was almost there, but reveals a new question.
The following simple (tags-only) search URL works:
x-devonthink://search?query=tags:tech%3Bterm
Clicking on the above search hyperlink results in:
The same happens when I paste the URL into Firefox (though I hear a meagre beep then). So I guess(!) the URL you used is slightly diffferent from x-devonthink://search?query=tags:tech%3Bterm%20kind:markdown