An Alfred Workflow for Drafts

Searching With Slashes and Across Lines

I know you posted an update to your observation, but just to confirm that in my testing this works fine.

As you can see above it is searching the title. It searches the whole content.

2021-04-23-18.22.30

What it doesn’t do is search multiple lines. For example, if I enter “defined There\nIts”, that will not work because Alfred doesn’t realise that the “\n” represents a newline in its own internal filtering mechanism, and as far as I know it offers no native way to otherwise denote a newline character. if anyone knows any different, please do let me know.

If you are instead hoping to match something like say “drfind forward down” with multiple terms being found in different places in the content, again, this isn’t something Alfred’s inbuilt filtering mechanism currently supports.

I could work around both of these by having the filtering be delayed but more intensive. As it stands I’m letting Alfred handle the filtering - its efficient. But, by repeating the query after a pause in typing and doing so by building a more dynamic query (e.g. splitting the words, double quoted phrases, transforming “\n” to a real newline character) it should be possible to create a version that would do that.

That’s out of scope for this initial release, but would be something I’d certainly consider working on adding to a later update if people would find an option like that useful.


Some Keywords Are Falling Back to Default Alfred Searches on Some Devices

Okay, so the workflow is in place, it is working for some keywords but not for others.

drsearch is a straight URL call. The drtitle and drappend don’t seem to be recognised. Both of those keywords will initiate a search at the points you are noting. I think what you are probably seeing is Alfred getting a null result and falling back to the default search.

My next question would be, have you got Python 3 installed on your M1 as per the pre-requisites?

If you are unsure, I helped someone check for it for using my Keyboard Maestro Alfred workflow the other week over on the Automators forum. Maybe give that a try if you are unsure.

Now it may not be that. it may be down to something in the scripting that isn’t quite working as it should because, for example, something isn’t where the script has been coded to expect it to be. In which case, we may have to look at running some checks and test scripts to get to the bottom of what’s going on.

Thanks for confirming the behaviour. Two people to check independently is very useful. Take a look at the above notes re. Python 3 and see if it is missing or if I have an issue with the script not taking into account a broad enough range of personal set-ups.

2 Likes