Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

simon.ward

macrumors newbie
Original poster
Feb 11, 2010
5
0
I'm writing a small utility app that needs to query the contents of the Applications folder. I need to ascertain which versions of certain Adobe apps are installed before finding out what plugins are present.

I'm trying to use the Spotlight APIs to do most of the heavy lifting. I construct the following predicate and set it as the predicate for an NSMetaDataQuery object.

"(kMDItemKind == 'Application') && (kMDItemFSName == '*Adobe*')"

I get meaningful results when I just use the first half of the predicate, but no results when I add the second half.

However, if I take the above predicate and use it with mdfind in a Terminal window, I get meaningful results.

Any ideas?

System - 10.6.2 on MacBook Pro 2.33 GHz
XCode 3.2.1
 
Re: NSMetadataQuery Question

... to make the second half working, change your string to (kMDItemFSName LIKE '*Adobe*')
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.