Searching Drafts from Alfred or Houdah Spot?

Sometimes, I know I wrote something and don’t know if it’s still in Drafts or has gone elsewhere (Obsidian or Word, for example).

I like to use either (Alfred with the in prefix) or (Houdah Spot). Neither of them seems to find text in Drafts. This is especially odd since I think that Alfred relies on Spotlight, and that does find text in Drafts.

Edit: I use many many Mac apps, and the Drafts docs are the easiest to navigate. Danke.

Do I need to wave a rubber chicken at Alfred? Add a folder location to Houdah Spot?

1 Like

I use the fantastic Alfred workflow - Doctor Drafts by the very talentend Stephen Millard to do that and much much more.

2 Likes

Of course, Stephan has created a tool. He always does. Downloaded.

However, this doesn’t address the deeper challenge. I want Drafts to be part of my universal search. This requires me to remember where I last worked on something: Drafts vs the outside world. Ideally Drafts could be added to the existing search of both Alfred or HoudahSpot.

Thanks for the kind words all. We need to look at how a few things here work in order to get a better grasp of what the options are.

The first, and most important point to take note of, is that Drafts keeps its content in records in a database rather than in files.

Given that Houdah Spot is for file searching (I use it too BTW), it simply isn’t on the menu for working with Drafts. It is a non-starter unless you are planning on searching through Drafts exports/backups.

Unfortunately, it is a fairly similar story with Alfred too. It is very much focused on things held in files in the default results set options.

It will also pull in browser bookmarks if that option is enabled (under Web Bookmarks), but there’s nothing more sophisticated in there yet that would allow it to deal with Spotlight’s index and non-files. I believe that is a design decision to ensure Alfred has super fast performance and dumps a bit of the baggage full Spotlight indexing carries.

As has been pointed out, the nearest option would seem to be the find functionality built into Doctor Drafts; allowing you to search in Drafts - if you want to explicitly do a search in Drafts. This is possible because it has some Alfred workflow-based functionality that taps into the Drafts database (only ever read only access) and effectively allows you to search the content of drafts in Drafts. But the issue for you on this is that you have to explicitly do the search with that command rather than it being built into your search results … or do you? Well yes. Mostly. But maybe there’s a bit of wiggle room here? Let me explain…

Alfred does have some functionality called fallback searches, and Doctor Drafts includes several of these that you can enable. Instructions and details are available on the website. They effectively allow you to get some additional searches incorporated into Alfred’s search behaviour. But only as a fallback - as the name indicates.

For your use case, I think that you will also want to ensure that you have the intelligently show fallbacks option set (bottom of the Default Results options page). If it isn’t set, fallback search options will only appear when there are no local matches found. However, it seems like you would want to know about local matches and then if none of those are what you want, as seamlessly as possible, segue into perusing the Drafts matches. This option will make that more convenient.

2024-10-31-21.20.49

If I search for the word “print”, that obviously gets a few local matches for me in Alfred as I have files and bookmarks containing that word. But in my results, note that I’m also getting an option to search for it in Drafts. So not the results integrated alongside the file and bookmark results, but an offer, as a next step, to try searching for it in Drafts.

2024-10-31-21.22.11

This is one of several fallback searches appearing at the bottom of the listing (the options I have actually extend beyond the bottom). I can then just select CMD+8 or click, or use the down arrow and return key to trigger a subsequent search step, which gives me my Drafts (only) results.

2024-10-31-21.28.18

Not the “perfect” solution, but we are constrained by the tools in this particular case. Hopefully this solution is close enough for you to get a workable flow going.

4 Likes

First up thanks for creating your Alfred Workflow.

I had wondered if there was a Database in use and now I know. The obvious solution - just @agiletortoise nicely to rewrite the app to move away from a DB to text files and built in version control. (Not serious).

I will look into fallback searches, which would be a good way of being reminded.

BTW your KM icon in Drafts Search made me smile.

1 Like

A little off topic, but for anyone who is interested, that’s for “Conductor”, my Alfred workflow for working with Keyboard Maestro. I have over a dozen Alfred workflows I’ve shared out for people to use, though Doctor Drafts remains the most extensive, and I do need to finish an update for it ai keep promising.

So much to do, so little time to do it… at least if you want to do it well :man_shrugging:t2:

1 Like