Ahh, that helps. I didn't think about it just calling mdfind. I was trying to use syntax that worked when using the Finder search window...
On May 18, 8:50 am, Rob McBroom <[email protected]> wrote: > On May 17, 2010, at 5:12 PM, sclough wrote: > > > 1. For applications, I'm using kind:app . However, it also indexes a > > lot of .jar file (Java programs). How can I say kind:app but name ! > > = .jar or kind != .jar in order to exclude files that I don't want > > listed in the catalog? > > This is the “noise” I referred to in my other post. Use “kMDItemKind == > Application”. Don't ask me why that gives different results. > > > 2. I'm trying to replicate recent items by creating a catalog for > > items opened today and yesterday. How do I combine the date:today and > > date:yesterday into one query AND how do I exclude email messages. > > It's including emails in the catalog and I don't want them included. > > Looks like you solved this, but for future reference, you can test various > searches on the command-line (in Terminal). Just do something like this > > mdfind "test thing" > > until you get the results you're looking for. > > > 3. Finally, to index documents how do I tell spotlight to include > > files under a certain directory. For example, everything in home, or > > everything in documents, etc? > > I'm pretty sure the Spotlight catalogue code just calls the `mdfind` command, > so you can use any of its options. So adding " -onlyin /Users/blah/Documents" > after your search query should restrict it. Again, you can test that option > on the command-line until you get the desired result. > > -- > Rob McBroom > <http://www.skurfer.com/> > > The magnitude of a problem does not affect its ownership.
