2008年3月19日 星期三

Spotlight, Smart Folders and (inconsistency of) MetaData


Last time I wrote about how to build "Smart Folders" out of Tiger's finder function with help from Spotlight and metadata from files.


Technorati Tags: , , , ,




But since I have upgrade to Leopard, I find that my old smart folder does not work anymore. The differences between Tiger and Leopard spotlight/smart folder that are important to me are:


‧ Spotlight gained boolean expressions

‧ Smart folder cannot specify source folder to search (10.5.2)

‧ Smart folder search gained boolean and sub-query functions (hold down Option key when clicking on the little "+" sign, and you get an indented sub-query.


All are functional changes with two to laud for and one to gripe for. As there is no point going back to Tiger installation, I have to live with the changes themselves. Ok, time to rebuild the "recent work on R* and M*" smart folder. Easy? Not at all. This is what I did and found out:


With the limit on where you can start your search, naturally I have to limit the search to file types. I tried the query and use "種類", which corresponds to "kMDItemKind" in the metadata. I expected to find options like "Pages document" "Numbers document" "Keynote document", etc. Instead, I have only a "文件" to choose from, which include almost everything other than images, video, audio and plain text. My search result ended up with tons of .cpp, .hpp, .java and such. These files are fine with you want to work with programming projects, but are quite useless if you want to consolidate all project schedule files and Pages/Word documents.


So I started digging around on the actual type for 1) Pages files 2) Numbers files 3) Word documents 4) Excel documents. These 4 types make up of over 95% of the project docs. To my horror, none of them have a standard naming scheme for ItemKind.


  • Pages files -> SLDocumentTypeNativePublication

  • Numbers files -> LSDocumentTypeNativeDocument

  • Word -> Word 97格式(doc) (you are not reading it wrong, it's in Chinese)

  • Excel -> LSDocumentTypeExcel


What I have are 4 ORed conditionals to pick out the file types modified within 10 days for all files under /Users/leafy, this is just bizarre. Also, from reading ADC docs, I tried kItemCreator. This works for Pages only (and picked only PDF files exported by Pages, not the .pages files themselves) and not Numbers. Looks like the applications are not writing proper metadata into the files. Apple, are your teams communicating? Are you Microsoft? I am quite disappointed with this situation, had always thought that Apple did a much better job than anyone else on metadata.


Please fix this, Apple!


沒有留言:

張貼留言