3

I am using tags to label all my documents in Finder, and Smart Folders to organise them, but I'm running into a roadblock.

Lets say I have a bunch of documents with the tag "fruits", and some -- but not all -- documents also have additional tags like "apples", "oranges" etc. There is an unknown number of additional tags. I want to create a Smart Folder containing file that have only the fruits tag, and nothing else. How do you do such an exclusive search?

2

Open a Finder window at the folder in which you wish to search. Press F to open a Spotlight search window, which will target that folder. There is a drop-down list that will have "Kind" selected:

Spotlight Search Window Bar in macOS

You will want to change this to "Raw Query", which, if it isn't available in the drop-down list, you can add by selecting "Other..." at the bottom of the list, then selecting it in the panel of search attributes that is presented:

Selecting Search Attributes in macOS

As your raw query, enter the following noting the triple equality:

kMDItemUserTags==='fruits'

Then click "Save" to create your Smart Folder.


Here's a demonstration using the coloured tags in Finder on the contents of the following folder:

This finds files tagged only Green (triple equality):

This finds files tagged Green ± other tags (double equality):

  • Awesome. Thank you. – user330662 Jun 27 at 3:47
  • What if I wanted files tagged 'fruits' and 'vegetables' only? – user330662 Jul 3 at 5:22
  • @user330662 Your phrasing is ambiguous so I don't completely know what you want. Hopefully, you're looking for files tagged with either fruits or vegetables (but not both nor any other tag): kMDItemUserTags==='fruits' || kMDItemUserTags==='vegetables'. If you wanted files also tagged fruits or vegetables or both, the closest I can manage is: (kMDItemUserTags==='fruits' || kMDItemUserTags==='vegetables') || (kMDItemUserTags=='fruits' && kMDItemUserTags=='vegetables'), however, this doesn't eliminate files tagged fruits and vegetables and any other tag. – CJK Jul 14 at 5:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .