Jump to content

Share a file filter among several keywords and outputs

Recommended Posts

I have several keywords for file filters, that lead to several outputs. The file filters are all actually the same; it's just the keywords and outputs that are different.


Is it possible at all to share the same file filter among several keywords and outputs, so I don't duplicate the filter? Since if I ever need to change it, then I have to modify it for every occurrence, rather than just a single one, which would make it much easier.

Link to comment

Yes, it's possible, but if all your outputs are connected to the same File Filter, you need a way to tell Alfred which output it should use.


The simplest way is probably to set a workflow variable after your Keyword and before the File Filter. Then after the File Filter, you can use Filter utilities and the variable to ensure only the correct output fires.

Edited by deanishe
Link to comment

Thanks for the response.


However, doesn't the File Filter need a keyword though? How do I create a keyword, which leads to a variable, which leads to a File Filter, if the File Filter itself needs a keyword and a search query, which will then filter the contents of the folder with the query?

Link to comment

I'm not sure how this is supposed to be done then?


I have attached screenshots showing what I have.


I created a test workflow, with one Keyword leading to one File Filter.


If I type "test asdf" in Alfred and hit Enter, it leads to "asdf" as the only keyword in Alfred, with no result.



3-File filter.png

Link to comment
1 minute ago, Gary King said:

The "keyword" field in "file filter" should probably be greyed out if it's receiving its input from elsewhere.


That wouldn’t be good. The File Filter can still be given and called via keyword. Greying it out would be lying about the state of the element.

Link to comment
  • 3 weeks later...
On 4/14/2018 at 5:36 AM, deanishe said:

Here you go. It doesn't do anything useful, but it should make clear how to connect multiple inputs and outputs to one File Filter.


Thanks for the example workflow.


I suppose it is not possible to have live updating results when using the File Filter this way? For instance, normally if you change your input keyword, then the results would change to use your new keyword. But with this workflow, you only get results once you submit your keyword to the File Filter.

Link to comment
  • 2 weeks later...
On 5/4/2018 at 9:41 PM, Gary King said:

But with this workflow, you only get results once you submit your keyword to the File Filter


Sure: the File Filter isn't run until you action the Keyword to pass control to it. As long as the Keyword doesn't require an argument, you can hit  immediately to go straight to the File Filter.


But if you want live feedback immediately, you need to duplicate the File Filter.

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...