NSMetadataQuery Question

Discussion in 'Mac Programming' started by simon.ward, Feb 11, 2010.

  1. simon.ward macrumors newbie

    Feb 11, 2010
    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
  2. timschroeder macrumors newbie

    Feb 12, 2011
    Re: NSMetadataQuery Question

    ... to make the second half working, change your string to (kMDItemFSName LIKE '*Adobe*')

Share This Page