Searching the Spotlight Database From The Command-Line
I’ve got a lot of MP3s, and I’m slightly obsessed with managing them. The problem is, I don’t know which ones are listed in my iTunes Library, and which ones aren’t.
Here’s how I used Spotlight to locate all the missing, “un-databased” MP3s.
First off, currently it’s not easy to create a Smart Folder that will match on a Boolean NOT. It’s possible, but not easy. The way to do it is to enclose the NOT term in parentheses, with a hyphen. For example, “bugs(-aphids)” would show all instances of “bugs”, and not “aphids”. As far as I know, there’s no good way to search for an empty set, or “”.