Jump to content
Jasondm007

[SOLVED] File Filters w. Multi-word Queries

Recommended Posts

Is it possible to create a file filter that operates as if each word in a query has a wildcard in front of it?

 

For example, let's say I have a file filter set up as follows: (1) Keyword is "pdf", (2) File Types set to PDFs, and (3) Search Scope set to ~/Documents/SmallFolder. Is it possible to change the file filter's Advanced settings so that the following Alfred search:

 

  • pdf SearchTerm1 SearchTerm2 SearchTerm3

 

approximates the following input:

 

  • pdf *SearchTerm1 *SearchTerm2 *SearchTerm3

 

In other words, when using a specific file filter, I'd like to avoid having to manually type a hyphen in front of each search term. I understand why you wouldn't want this to be the default behavior in Alfred, but I was hoping to create some file filters that work in this manner (on small folders, etc., so that they're not too system-intensive). @deanishe has a nice fuzzy folder search, which is robust enough to do a lot of the same things, but I was just wondering how to mimic the wildcard search described above. 

 

I've never quite understood how many of the options in the File Filter's Advanced tab work (beyond simply adding more Metadata Files that are not included by default), and I was hoping there was a way to change these settings to achieve what I've described above. Initially, I thought that (1) unchecking the "words" column, and (2) unchecking the "Anchor searches which are not word based" would have the same effect. However, I'm not receiving the same result as when I use wildcards.

 

Thanks for any help you can lend!

Share this post


Link to post

I don't think there's any way to do what you want with a File Filter. No official option to do that and no way to edit the query before it reaches the File Filter.

 

The only thing I can think of is writing a workflow based on mdfind. Then you can manipulate the search query however you like.

 

Perhaps my Smart Folders workflow would help? You could create a Smart Folder for PDFs and then filter that with the workflow (it uses much laxer matching than Alfred). It will not work terribly well if you have thousands of PDFs, though.

Edited by deanishe

Share this post


Link to post

@deanishe Thanks for the feedback! I'm sorry to hear there's no easy way of doing this in the File Filter's options.

 

Thanks for recommending your smart folders, too. I'll take a look.

 

By chance, do you know of any workflows that use mdfind to search for files in a similar fashion (or any fashion, for that matter)? I'm just looking for place to start, so that I can get an idea of how to build such a workflow. Thanks!

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...