Jump to content

Script Filter: How to display an item when nothing is matched?


Recommended Posts

So I am trying to tinker with the match-property of script filters. My idea is to have an item only show up when there are *no* matches. The idea to use that for searches that show basically a fallback like "create new X" when no matching item is found.

 

I know that you can basically do that by running a query on every keystroke (i.e. disabling "Alfred filter's results"), but I'd rather let Alfred search the JSON in a smart way than writing the search completely myself.

 

Is there any solution to this I am simply not aware of?

Link to comment
1 hour ago, armenaton said:

I know that you can basically do that by running a query on every keystroke (i.e. disabling "Alfred filter's results"), but I'd rather let Alfred search the JSON in a smart way than writing the search completely myself.

 

Can’t have it both ways, it’s either one or the other. I think there’s an open Feature Suggestion to optionally make Alfred filters results show No results found, but I’m not finding it.


But what you seem to want is a way to, on no results, have another result that is itself actionable. That is trickier to implement and fit into the GUI. I don’t expect it to happen.

 

Writing the search yourself isn’t complicated. But it might be easier if you make a Keyword Input for the no-results case and make its keyword the same as in your Script Filter. It will still show up even when there are results, but it will either be the absolute first of absolute last item (depending on what’s the norm) so it’s easy to ignore.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...