I have written a Spotlight Importer for the custom document type my application defines.
Everything is working fine, the metadata fields are correctly indexed by Spotlight (verified using mdls
command), and a Spotlight search reveals my documents.
The only problem I have is that items I specify in the <displayattrs>
section of the schema.xml
file aren't displayed in the "More Info" section when I ask for informations about a file (Cmd+I in the Finder).
I expected these fields to appear there because I declared them both in the <allattrs>
and <displayattrs>
sections.
I found few questions here related to this problem, none of them helped me.
The importer is bundled into the app, loaded by the system (mdimport -L
confirmed this).
Also, the bundle structure seems right, the schema.xml
appears in the Resources folder, as well as the schema.strings
in the en/lproj folder.
Here is what the schema.xml
file look like :
<schema version="1.0"
xmlns="http://www.apple.com/metadata"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.apple.com/metadata file:///System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Resources/MetadataSchema.xsd">
<types>
<type name="com.mydomain.myapp.mydocument">
<allattrs>
kMDItemTitle kMDItemAuthors kMDItemAlbum
</allattrs>
<displayattrs>
kMDItemTitle kMDItemAuthors kMDItemAlbum
</displayattrs>
</type>
</types>
A couple of things more, my system is lacking the mdcheckschema
command, but the XML file is so short, I doubt there is a problem with the syntax.
Sometimes, the "More Info" section display the file last opening date, sometimes nothing.
Finally, I tried reimporting the file (mdimport
), to no avail.
I'm running Mac OS X Moutain Lion 10.8.3, Xcode 4.6.2.
So here my question, am I missing something to have those items displayed in the "More Info" section ? Is there someone who has experienced such a problem and found a solution ?
Edit :
Nobody answered my question so far, maybe someone can point me to some tutorial or documentation about this problem ?