I am trying to create a smart search folder that only searches for items contained within specified folders. I have tried using the "Document Container" attribute, but I can't figure out how to use it correctly. Can someone walk me through an example of creating this kind of smart search?

  • Just navigate to the desired folder before creating the smart folder - or are you wanting to combine a group of searches?
    – red_menace
    Commented Nov 6, 2019 at 22:47
  • Yes, I would like to include several folders and also have the ability to exclude folders. How do I do that? Commented Nov 8, 2019 at 0:03
  • @red_menace , I am aware that if you navigate to a folder and then create a smart folder, you can choose to only search within that folder; however, I would like to search multiple folders and exclude folders. Ankii, I looked at all of those links you attached, and, unfortunately, none of them answered my question. Do you know how to do this? Commented Nov 8, 2019 at 2:36
  • 1
    As indicated in the previous links, there isn't a way to specify search folders in the Finder's Smart Folder query, so you would need to use a shell utility such as find or use something like NSMetadataQuery from a Cocoa app or script. You wouldn't be able to use the Finder for the results, though.
    – red_menace
    Commented Nov 8, 2019 at 2:56


You must log in to answer this question.

Browse other questions tagged .