• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Writing a custom Spotlight Importer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Writing a custom Spotlight Importer


  • Subject: Writing a custom Spotlight Importer
  • From: Vincent CARLIER <email@hidden>
  • Date: Wed, 01 May 2013 11:36:11 +0200

Hello everybody,

I've written a Spotlight Importer for my custom document format. The
document has an UTI, used by the Spotlight Importer.

Everything is fine, I can see my Metadata Fields correctly indexed by
Spotlight, I can see the right importer loaded (it is bundled into the
.app) when I run `mdimport -L`, except the Finder doesn't display the
fields I've said it to display.

Here is what the schema.xml file look like :

   <?xml version="1.0" encoding="UTF-8"?>

   <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/metadatafile:///System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Resources/MetadataSchema.xsd
">
   <attributes>
       <attribute name="com_myDomain_myApp_myDocument_test"
multivalued="false" type="CFString" />
   </attributes>
   <types>
       <type name="com.myDomain.myapp.mydocument">
           <allattrs>
               kMDItemTitle
               kMDItemAuthors
               kMDItemAlbum
               com_myDomain_myApp_myDocument_test
           </allattrs>
           <displayattrs>
               kMDItemTitle
               kMDItemAuthors
               kMDItemAlbum
               com_myDomain_myApp_myDocument_test
           </displayattrs>
       </type>
   </types>
</schema>

I wasn't able to validate this file syntax (but it seems right), my system
is lacking the `mdcheckschema` command, and I can't find it anywhere. Also
I thought that fields appearing in the `<displayattrs>` would have been
displayed by the Finder's Get Info pane.

The `schema.xml` file appears at the right place into the mdimporter
bundle. This is really annoying, since I use already defined fields, and
only one custom field. Apple's documentation doesn't tell anything on this
situation and I wasn't able to find an answer to my problem.

Does anybody know what to do to have those informations displayed by the
Finder's "More Info" section ?
Maybe someone can provide useful tips ?

Vince.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: setFrame: weirdness in UITableViewCell
  • Next by Date: Re: What am I looking for in the documentation?
  • Previous by thread: Re: Setting Up a MVC most of it works BUT
  • Next by thread: UIWebView IBOutlet is always nil
  • Index(es):
    • Date
    • Thread