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?


Solution 1:

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):