Jump to content

How to search by tag and filename at the same time?


e.c

Recommended Posts

I'm trying to incorporate Alfred in my workflow but something I am having trouble with is combining file search with tags and filenames. Spotlight seems to have no issue with this so it feels like Alfred should be able to do it too but I can't figure it out. Anyway, here is a typical situation I am interested in solving:

 

I have a handful of files tagged `projectname`. Some of these files have the word `receipt` in the filename (e.g., `hotel receipt.pdf`). I would like to be able to open Alfred and type `tags projectname receipt` or even just `projectname receipt` and have it show me files tagged `projectname` with `receipt` in its name.

 

Is this possible?

Edited by Eric C
Link to comment
On 8/27/2019 at 12:09 PM, Eric C said:

Is this possible?

 

I don't think it is, no. Perhaps @Vero can confirm.

 

Alfred won't let you match across multiple fields (unlike Spotlight). So if you enter projectname receipt, Alfred will only show items where both words are in the tags or both are in the title. It won't show results where one word matches tags and one matches the title.

Link to comment

@Eric C Alfred constructs more specific, more accurate queries than Spotlight, but the drawback is that it's not possible to match different values across multiple fields in a single query. However, it's possible to create a workflow with multiple parts, where you first set the tag, then search within tagged items.

 

Here's a workflow for you to play with, using the keyword "ftag":

https://www.dropbox.com/s/uggoywmzxj6pllb/tag file search.alfredworkflow?dl=0

 

Type the name of your tag, hit return then type the name of the file.

 

Cheers,
Vero

Link to comment
  • 2 weeks later...

@Eric C if you update to the 4.0.4 b1108 pre-release, I've made a tweak to allow * as the Metadata Field allowing you to do the broad style of matching across multiple metadata fields as you described.

 

Configure the file filter as follows, then you'll be able to type the file name and tags e.g. `projectname receipt`.

 

multi field file search.png

 

Let me know how you get on. I have plans on improving this further in the future :)

 

Cheers,

Andrew

 

 

Link to comment

@Andrew Thanks for making this update! It's super helpful!!

 

Quick Question: Is it searching all available metadata fields or just the usual nine fields listed in Alfred's dropdown? Thanks!

 

As for the improvements you alluded to above, is there any way this will include the ability to limit/specify the metadata fields? 😀🤞

 

Alfred rocks! Thanks again, @Andrew!

Link to comment
1 hour ago, Jasondm007 said:

Quick Question: Is it searching all available metadata fields or just the usual nine fields listed in Alfred's dropdown?

 

You can put any metadata field in that table, and some may give worse performance than others, just experiment. If you want multiple fields, just add them all manually.

 

Cheers! :) 

Link to comment
1 hour ago, Andrew said:

You can put any metadata field in that table, and some may give worse performance than others, just experiment. If you want multiple fields, just add them all manually.

 

Cheers! :) 

 

My apologies @Andrew, I should have been a little more clear.

 

I was asking whether the fantastic new * method for finding matches across multiple fields - as you've shown in the screenshot above, with the metadata field set to * - is limited to searching the nine default fields provided in the file filter or whether Alfred's actually searching all metadata fields on our system (e.g., kMDItemTextContent, kMDItemFSName, and all else)?

 

Thanks again!

Link to comment
  • 4 years later...

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