Powerful Searches With Raw Query

You can search for files using the Raw Query function in the Finder. This gives you the ability to use wildcards to search for files with specific file names. You can also use other file attributes and combine them for even more complex searches. Raw Query is also very fast and can search your entire drive in seconds.



Apple Spotlight Metadata Attributes page.

Comments: 17 Responses to “Powerful Searches With Raw Query”

    Rick
    9 years ago

    Hi Gary,

    I want to thank you for your insightful and instructional videos. I have learned so much from your podcasts. I've been playing around with content searches within the finder but have yet to find what I'm looking for. I want to be able to search for lower case .jpg instead of .JPG and cannot seem to have finder differentiate the two.

    Have you found something that I'm missing in my search?

    Best
    Rick

      9 years ago

      This video is pretty much about exactly how to do what you want. Watch the video. Then use the Raw Query with:
      kMDItemDisplayName = *.jpg
      This will give you only the files with lowercase .jpg at the end.

        Rick
        9 years ago

        Thank you Gary. That worked!

    Lance
    9 years ago

    Hi Gary, I tried this out and it's really cool. I discovered that that the metadata attributes are completely case sensitive so I couldn't just type in the metadata attribute. I had to make sure all the capitals were indeed capitals and then the search happened instantly. Thanks for this pretty geeky tool that is now at my fingertips.

    Nilesh Parmar
    9 years ago

    This is great for finder would this work in spotlight too?

      9 years ago

      This IS Spotlight. Finder searches are also referred to as spotlight searches. Perhaps you mean using the Spotlight menu instead of the Finder search window, at the top? You need to do this at the top of a Finder window since you have to specify "Raw Query" as I show.

    Furlan
    9 years ago

    Hi gary, thanks from Brazil! Could you post the URL?

      9 years ago

      Sorry. Forgot to post that. I just put a link above, under the video.

    Betty
    9 years ago

    I had a hard time finding music to fit my movies. Thanks for this information. It has made my day!

    John Ford
    9 years ago

    When I hit space bar in search I get a minus not a plus next to the 'save' button on the right. How do I add the additional search features?

      9 years ago

      If you have no search modifiers in the list yet, you get a + button. Once you add your first, it is a - button, but a - and + button appear below it with the first modifier. Just use the + button there.

        Jeff Eichorst
        9 years ago

        Hi Gary,
        I can't seem to get the + to show up for anything. Whether I put something in the search window or not, I always have just a - next to the "save" button.
        Any suggestions?

    Rick
    9 years ago

    Is there a way to limit the number of results displayed? If it yields say 1000 to 2000 at a time then I can actually rename or tag or move items.

      9 years ago

      Depends on what you are doing. You limit the results by adding more conditions to the search, usually.

        Rick
        9 years ago

        I want it to display 1000 to 2000 at a time such as an iTunes smart playlist.

          9 years ago

          OK. But if you notice that when you create a smart playlist in iTunes, and you "Limit to" 1000 or 2000, you have to select criteria. The options are things like random, rating, artist, etc. So if you select by artist, for instance, you get the first 1000 songs when sorting by artist. So in the Finder you would do the same thing, just sort by filename or something else and then just only view the first 1000 and ignore the rest. I'm not sure of the utility of cutting off the list at 1000, though. In iTunes you do it to make syncing easier or only show you the songs you have rated highest -- but in the Finder, what would that get you?

            Rick
            9 years ago

            I would use this to tag original photos with Device_Date_Time_Original File Name.JPG for example. Tagging software become non responsive once I exceed 2000 photos at a time.

Comments Closed.