I’ve been messing about with Tiger. So, the rest of this may be of interest to about half of you.
The ars.technica article on Tiger pointed out that spotlight does boolean just fine. Only, it doesn’t do it through the GUI cause Apple thinks we’re not so bright. Oh well.
But, it was pointed out by MacGeekery that you can use a search type of “Raw Query” and enter whatever sort of complex boolean soup you like in the GUI. You can get the metadata types you need by dropping to the terminal and running mdls (mdls is my new favorite thing) on a file you’d like metadate for.
Like so: mdls foo.zip
You’ll get a stream of various metadata types that look like kMDblahblahblah = value. With that you can make all kinds of nifty searches.
Here’s a little recipe I came up with to find all my downloaded files:
(kMDItemWhereFroms "http://*")||(kMDItemWhereFroms "Received via iChat file transfer.")
What that does is look for anything where the “WhereFroms” is “http://*” or anything where the “WhereFroms” is “Received via iChat…” You obviously get that. I just wanted to make sure.
Now, you can just make up a new Smart Folder, set the type to Raw Query (select other then search for Raw), then paste that bit into the text field. You can stop there if you like or you can hit the plus sign and add a search for “Last Opened with in last 7 days”. Or however many days you care to have it. That way you can track Downloads and Recent Downloads.
Whatever you think of this I highly suggest hitting the terminal and running mdls on some of your files. It’s much easier to make a Spotlight recipe if you know what you need to have before hand rather than trial and error. I also find making recipes via the Raw Query method far easier.
Update:I’ve found a workaround for something that was bugging me. If say, you’re like me and write a lot of stuff in Textwrangler that ends in .html you’ll quickly find that a query for kMDItemKind "HTML File" will pull up every html doc on your system. But, instead of using kind use the creator code. You can do this via the GUI or just use kMDItemFSCreatorCode 559047528. Use mdls to find other creator codes.
Why do I bring this up? I’m working out a SavedSearch for all New Creations made using applications like Textwrangler, Photoshop, Pages, etc… I’ve worked out the creator code spaghetti I need. I also found that TextWrangler creates aliases for recent documents. These aliases will show up in the search so far. So, to get rid of those you need to do some nesting.
((kMDItemFSCreatorCode 559047528)||(kMDItemKind "Adobe Photoshop file")||(kMDItemKind == "Pages Document"))&&((kMDItemKind != "Alias")&&(kMDItemID != 293049))
Now, that looks like a lot. It’s really not. Just watch your parentheticals. The first three statements grab all Textwrangler, Photoshop and Pages documents. The last two excludes aliases and file filters created by TextWrangler. I’m certain that the more things you include the more things you’ll want to try and exclude. I’m also certain there are more precise methods but this is a learning process. I just wanted to really hit home the actual broad ability of Spotlight Queries.
Update:To get a list of files that do not have comments you can use (kMDItemFinderComment !=*). I think this is a great way to round up those bits you haven’t commented yet as I’m sure we’ll all see that using comments in the future would be most advantageous now that we have Spotlight.
I have to say that, for me, Spotlight is living up to everything I expected it would.
Update: I wanted to show off how I’m using some of these “recipes”. This is a screenshot of a SavedSearch using the “no comment” query. I just keep this window open and whenever something pops up in I add an appropriate comment to the file. Commented files just add that extra bit of metadata. If you click the image you’ll go to the Flickr page where you can view large sizes.
Spotlight Recipes

