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

Thanks for the suggestion, and apologies to keep you waiting. While this actually looks nice, I can’t implement that in any way that makes it useful.

  1. Using a regular expression search in DT: That would permit to find strings in PDFs and text documents like HTML, Markdown and RTF. However, doing it with a script is far too slow to make it useful
  2. I thought about using egrep from the operating system. However, it can’t search PDFs (at least, I don’t think it will be able to). Which makes this approach close to useless, too.

So, currently, I’m unable to implement that in a way that makes sense.

I’ll have a look at that.

Forgive me for reopening this discussion a few months on. I’ll echo others’ thanks for putting in all of the work on this terrifically useful Workflow. I’ve got a couple questions, and a suggestion for an added feature:

  1. When I use the “dts” search, select a group from the results, and hit enter, nothing happens (other than it moving up to the top place in the search results in the Alfred list, if it wasn’t there). Similarly, if I press option-enter, nothing happens. In contrast, if I use the “dtf” command, select a group, and press enter, that group opens in DT (which I think of as the expected behavior). Is there some reason those are different – and, if so, is there a way I can get the results to the “dts” search to react by default in the same way that the results of the “dtf” command?

  2. Similarly, if I select a file that I locate using a “dts” search and press enter, the file opens in the default application for that type of file, rather than opening in DT. If I select the same file from the results of the “dtf” command, it opens using DT. Is there a way to make files that I locate using the “dts” search open in the same way that files identified through the “dtf” command do (i.e., within DT)?

  3. You asked about possible features to add. For me, at least, it’d be helpful to be able to run a search within a given group, as opposed to having to run them across a whole database. Is that something you could add (or teach me how to do myself)?

Thanks for raising these points here.

Firstly, the source and the workflow are now available on GitHub. I’ll try to keep that up to date, though it’s a PITA doing that with an Alfred workflow.

Please keep in mind that I tried to mimic the behavior of the original workflow here. I may have messed up, or the original behavior was not the best possible one, of course.

  1. I’m not sure if dts should even show groups. The problem here is the default action: it opens the result in its default application, and there is none for groups. So, the workflow would have to discern between groups and ordinary records for the default action. I’ll have to look at that.

  2. The file opening in the default app on Enter is the “expected behavior”. Use Opt-Enter to show the record in DT. Use Cmd-Enter to open it in DT in its own window. Use Shift-Enter to copy the entry as a Markdown link (that is probably a bad choice, should be Cmd-C).

  3. I’ll have to think about that – there’s no “select group” action yet, but that is related to your first point.

Thanks very much - those are helpful explanations!

This has been fixed now. Enter on a group opens it in a new DT window.

I added that now. Please re-install the workflow from

You have to select a database first, then have it display its groups with Ctrl-Enter and then select the group with Cmd-Enter. Perhaps a bit contrived, but I’m not convinced that having a “list all groups from all databases” functions would be a good idea, given the possibly huge number.

Please let me know what you think.

Apologies for the slow response, and thanks very much for implementing these changes. It’s an impressive workflow, but for me, at least, the delay in loading all of the groups in a given database (which happens each time I run the workflow to get to a search of a specific group) makes it significantly less useful. Is there an easy way in Alfred to establish a trigger for searching a specific group? I have one particular group that I regularly want to search using Alfred, and rather than needing to navigate to the database, waiting for groups to load, and then navigating to that specific database before running my search, I’d like to be able to just press a keyboard shortcut or enter an Alfred trigger, then immediately be able to enter the search terms and have results from that group show up within Alfred.

Perhaps mine is an unusual use case that’s not worth trying to implement in a general-purpose workflow. But if there’s an easy way for me to set that up, I’d be grateful to know about it!

And thank you, again, for making the workflow available and for all of your other contributions in the forum!

The short answer would be: Add an action that sets the environment variables “searchGroup” and “selectedDbName” to the name of the group and the database you want to search in, respectively. This action should also require an input, namely the stuff you would like to search for. Connect this action to the Script Filter action with the shortcut “dts”. That should do the trick.

Alternatively, one could cache the groups for each database and only update them occasionally. That would speed up the group display considerably, but require a lot more coding in Alfred.

This worked:

The short answer would be: Add an action that sets the environment variables “searchGroup” and “selectedDbName” to the name of the group and the database you want to search in, respectively. This action should also require an input, namely the stuff you would like to search for. Connect this action to the Script Filter action with the shortcut “dts”. That should do the trick.

Thanks very much for helping me get this set up – I anticipate it will save me quite a bit of time going forward!