Searchable aliases?

Hello dear DEVONthink’ers!

I have the following use case. I have a document (a PDF book) with the name in Language A.

I know, that this same book has been translated into a Language B, and has a different name in that language (obviously).

I want to add the name of the book in Language B, since this is how my brain sometimes works (I might search for that book by its other name).

My idea was to add the name in Language B to the “aliases” filed. However, the search by the alias did not return any results.

Am I using aliases wrong? what would be a better approach?

thanks !

It’s impossible to tell without seeing what you’re actually doing. I can guess but a visual of the search as well as the alias you used would be helpful.

here, I have DEVONthink manual, as an example. I add an alias “DAS MANUAL” — the search by “das manual” does not return anything.

expectation: I see the DEVONthink manual in the search results

Show your search as well.

Just as I guessed. As has been spoken of often on these forums, in blog posts, and in the documentation, you should be specific when doing searches. What you searched for are two words – not even necessarily related – that could be anywhere in a name, contents, some metadata, etc.

If you’re searching for aliases, you should provide the appropriate search prefix. This will either be aliases== when you have one alias per item or aliases:~ to match substrings or have multiple aliases.

2 Likes

Thanks, I see!

I guess adding this info to the aliases won’t work for me, since in this case, I would need to remember to explicitly search for an alias :sweat_smile:

I did a workaround now by adding a note to the title of the book directly in the pdf with an alternative name. It works this way.

Which chapter in the manual or the help section would you recommend to learn more about how to use search…? I feel like I’m only using 5% of it’s capabilities.

Windows > Main Window > Search Pane give some tips and links to deeper relevant sections about the syntax components in the Appendix, namely Search Operators and Search Prefixes.

1 Like

You can use scripts or URL commands to “save” common search patterns :smiley:

AppleScript example:

-- Search: Name & Aliases contains <query>

tell application id "DNtp"
	set userInput to display dialog ¬
		"Name or Aliases contains:" default answer ¬
		"" with title "Search"
	set searchTerms to text returned of userInput
	set theQuery to "any: name:~" & searchTerms & " aliases:~" & searchTerms
	set theWindow to open window for record (root of inbox) with force
	set search query of theWindow to theQuery
end tell

Shortcuts example:

(I would prefer Raycast over Shortcuts, though)

1 Like

Thanks! That’s cool!

You have mentioned Raycast. Could you please elaborate a bit how exactly would you use it in this use case…? Or how are you generally using it with Devonthink?

Are you familiar with Raycast? It has a feature they call “Quicklinks”. You can use dynamic placeholders in these links‌, which makes them pretty flexible. Also, Raycast automatically does all the URL-encoding for you.

This Quicklink would be equivalent to the shortcut above:

x-devonthink://search?query=any: name:~{argument name="Query"} aliases:~{argument name="Query"}

Give it a name (with a short alias or even a hotkey if you want) and access it like everything else in Raycast.

I find this much simpler to create and run than using the Shortcuts app.

You can also run scripts with Raycast (using Dynamic placeholders) if you want to, but the Quicklink with an x-devonthink:// URL-command was what I had in mind. (You can read about the different URL-commands in the DT manual.)


More generally:

I use Raycast in pretty simple ways. I just generally prefer keyboard navigation, so I’ve been using a launcher app for ages. For the last 1-2 years that has been Raycast.

  • I gave DEVONthink the alias d. So I open or switch to DEVONthink with Cmd-Space, d, Enter in under a second.

  • I used the File Manager extension to add my ~/Databases directory to my favorites. This way I can quickly browse a list of all my DEVONthink databases when I need one that’s not already open.

  • I added a Quicklink to the “Today” smart group to my favorites.

  • Someone wrote a DEVONthink Extension for Raycast. It’s pretty handy for quickly searching database items when I’m in another app. I gave it the alias ds.

I also use Raycast’s Clipboard History and Emoji’s & Symbols picker a lot, but that’s not really DT-specific. Plus a few other unrelated extensions. I could probably use the snippet manager, but I already have a text expander.

1 Like