Self-contained version of Alfred workflow (i.e. without Python)

I’m not sure how many people here are using the Alfred workflow, posted here about three years ago. This workflow depends on the correct version of Python being installed, which is a bit awkward. So, I rewrote the workflow without this dependency (using JavaScript and osascript). I contacted its original author some time ago, but got no reaction.

So, in case anybody is interested, the Python-less workflow is available here. AFAICT, it works with Alfred 4 and the upcoming version 5.

It uses the same keyboard shortcuts as the original software and should do the same things. But I didn’t test it thoroughly, so some kinks might remain. Please let me know, preferably by PM, if you stumble upon a problem.


Bravo - this is awesome. I wish I had the time to convert all my old Python workflows…I’ll send you details on a few issues with DTS and DTF commands.

Please post in the Alfred forums as well.

Many thanks - had a quick mess around with it, and it’s looking great.

Much appreciated: many thanks for all your work.


Update: There was a bug in the “Search DT” (DTS) function when no database was selected. It should work now.

Also, the keyboard shortcuts are not the same as in the original version. Instead, they are prefixed with “DT” (instead of “DN”). That makes it possible to have both workflows installed in parallel (to compare results or whatever).

1 Like

DTS bug seems fixed; many thanks.

Also, I just discovered the shift-enabled “copy markdown link”, which is brilliant.

One question about the results order -what’s the default sort order? And is it possible to configure that (or, at least, to add “relevance” as they primary sort order)? Again, many thanks for this.

Which results do you mean?

  • Databases are sorted alphabetically
  • Tags are sorted alphabetically
  • All records with a certain tag are listed in the way DT returns them. That is (or should be) the same order DT uses when you type “tags: <tagname>” in its search field.
  • Searching in DT (with dtd/dts or dts) again runs a search query in DT. Although, in this case, if you haven’t selected a database first with dtd, all databases are searched one by one so that you get “most relevant result in DB1, second most relevant result in DB1, …, most relevant result in DB2, second most relevant result in DB2,…” and so on.

I don’t know if the latter is a problem (or even if it makes a difference if I leave out the database specifier for a search over all databases)

Got it - this last was my confusion, as it differs from searching within DT (or with the python-bsaed workflow). Thanks for clarifying. Screenshots showing the workflows (dts and dnt) searching on the same term, with DT running the search with results in background.

1 Like

Thanks a lot for your explanation. I (hope to) have corrected that behavior now. Records are listed by database and then by relevance (i.e. most important one for DB 1, second most for DB1, … most important one for DB2 etc).

I also fixed some other bugs and refactored the whole thing to use external scripts. That makes it easier to text externally, too. Still figuring out how to put the whole thing up at GitHub, though, without causing too much work to update etc.

The workflow is much faster now – enough to actually become useful to me. Thanks, @chrillek.

It is indeed faster, and many thanks for addressing the results issue. DevonThink and Alfred are without question my most-used apps, both separately and together.

Thanks for your kind words, @Bernardo_V, @lutefish, @Stephen_C, and @jongilizwe.

Is there anything else that you’d like to see in this workflow? I fiddled around with a regular expression search over all records in a database or a smart group – both of them unfortunately take an inordinate amount of time as I implemented it. Any other ideas?


It seems rude not to reply after you’ve put in so much effort, so this is merely to acknowledge that your workflow does all that I need. Although I use Alfred a lot I always have DEVONthink open so that my most used database (diaries) is constantly available and—more often than not—I simply switch to DEVONthink and search there. That said, the workflow is really useful to have as a sort of “searching backup” and I tend to use it for other, less frequented, databases.

All of which is an awfully long way of saying, it’s fine as it is for me! :grin:


1 Like

I also can’t think of any functionality you might add that I would use. It covers search and links, and those are the core Alfred/DT actions I rely on.

This is amazing, thank you!

I tried out the older Alfred workflow just last week and ran into the Python issues. Fixed some of them, but had to shelve that task and then didn’t get back to it.

This replacement is just what I needed (and, I suspect, lots of other people would like too).

(also, I hope this is taken up and curated by the folks at Alfred, because it’s scripts like this that will keep it relevant in the face of new upstarts like Raycast)

Thanks for mentioning that. I had a short look at it and don’t think it’ll lure me away from Alfred: you have to use React to provide an interface and write Typescript code for the functionality. Far too heavy and convoluted for my taste.

What’s worse is that there’s no apparent integration of JXA. So one would have to jump through some loops to script apps in this environment. Which is not necessary with Alfred.


Of course, you can also use AppleScript with Alfred <ducks and hides>. :wink:

Edit: forgot to escape chevrons!



Just found this workflow, (also compared it to the python version).:
Stunning and made me fall for it right away :tada:. I regret every day I did not find this earlier on.

Working on an M1 it’s reasonably fast. Faster then going into DT itself for quick searches. Should be my standard for retrieval workflow now. Excellent integration with the Alfred actions. E.g. find some file via DTS then let Alfred send it to Yoink, drag into destination like open email etc. Works like a charm.

Many Thanks for this !!!

more ?

As you ask for wishes for improvements / additional features — here are some:

  • Regex search would surely be superb.
  • saving searches for reuse
    • may be another keyword like DTSS were previous searches appear in rank of use like Alfred, ready for hit and go w/o retyping
  • being able to select several files from search result for action (not sure Alfred allows this?)

… because you asked for it — I don’t want to sound unkind or ungrateful in the light of what you already accomplished

1 Like

+1 You should definitely post as a fork or python-less clone of the original workflow in Alfred forum

I posted this on the Alfred forums already, about a week ago.