我想做一个 Spotlight 查询来查找本地硬盘驱动器上的 Aperture 库。一个非常简单的方法是使用 kMDItemKind 但它的值取决于当前的用户语言:
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";
}
那么如何进行与语言无关的查询呢?
mdfind "kMDItemKind == 'Library'" > 什么也不返回
mdfind "kMDItemKind == 'Aperture Library'" > 工作正常