3

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

Pol
  • 3,848
  • 1
  • 38
  • 55

2 Answers2

0
mdfind "kMDItemContentTypeTree==XXX"

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

Tim
  • 1,659
  • 1
  • 21
  • 33
0

You can also use the name extension ".aplibrary"

mdfind "kMDItemContentTypeTree == 'com.apple.package' && kMDItemFSName == '*.aplibrary'" 

iPhoto libraries and Aperture libraries is "com.apple.package"

jackjr300
  • 7,111
  • 2
  • 15
  • 25