Search code examples
macosspotlight

How do do a Spotlight query that's language independent?


I want to do a Spotlight query to find the Aperture libraries on the local hard drives. A very simple way would be to use kMDItemKind but its value depend on the current user language:

kMDItemKind =     {
    "" = Library;
    de = "Aperture-Mediathek";
    en = "Aperture Library";
    fr = "Phototh\U00e8que Aperture";
    ja = "Aperture \U30e9\U30a4\U30d6\U30e9\U30ea";
    "zh-Hans" = "Aperture \U8d44\U6599\U5e93";
}

So how do you do a query that's language independent?

mdfind "kMDItemKind == 'Library'" > returns nothing

mdfind "kMDItemKind == 'Aperture Library'" > works fine


Solution

  • mdfind "kMDItemContentTypeTree==XXX"
    

    should do that, with XXX being something listed in the kMDItemContentTypeTree for Aperture Files.