advertisement

Article:
  Creating Spotlight Plugins
Subject:   Package File Formats
Date:   2005-07-21 09:00:17
From:   SADev
Just an FYI - my own importer did not work until I found the Apple "NoteTaker" example code at the URL below. The text file included in the example explains the three vital steps needed to make the importer work with a package:


The relevant text is:


"The import parts of this importer are the changes made to the Info.plist file. First, it use the UTImportedTypeDeclarations instead of UTExportedTypeDeclarations so that if NoteTaker does declare its own UTI for its file format that it will not override the one declared in the importer.


Next, the UTTypeConformsTo section shows how you should declare a file format which is a package. Getting the type hierarchy correct is import for your files to display properly in the Finder and Spotlight search results.


Last, the implementation of GetMetadataForFile() shows how you can get the information out of a package using the Cocoa api's."


Example Link:
http://developer.apple.com/samplecode/Spotlight/listing10.html