Designating UTIs for non-document files written by application
Designating UTIs for non-document files written by application
- Subject: Designating UTIs for non-document files written by application
- From: "Doug Knowles" <email@hidden>
- Date: Thu, 21 Sep 2006 11:40:03 -0400
Hi, all,
I'm writing an app that writes cache files (representing individual
records within a document) to be processed by a Spotlight importer
embedded in the app. Currently, I'm stuck because my cache files are
being assigned a dynamic UTI (dyn.mumblemumble...) instead of the UTI
I designate in my info.plist, even the the UTI I assign to my document
files is getting assigned correctly (as reported by mdimport -d1). In
fact, none of the file info is being picked up; the finder reports its
kind as a generic "Document".
The relevant snippets from my info.plist are below.
One thing I was wondering whether the way I'm writing the file could
be an issue. I'm using NSDictionary's writeToFile:atomically to
generate the cache files (with the appropriate extension, of course).
Shouldn't the extension be sufficient to type the file?
While I'm at it, is there a technique for examining what the system
has been told about my application; i.e., to determine which file
types have been registered? Running mdimport on a sample file seems a
bit indirect.
As always, TIA.
Doug K;
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>slndb</string>
</array>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>application/octet-stream</string>
</array>
<key>CFBundleTypeName</key>
<string>SLNavigator database</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSItemContentTypes</key>
<array>
<string>com.selene.slnavigator.slndatabase</string>
</array>
<key>LSTypeIsPackage</key>
<false/>
<key>NSDocumentClass</key>
<string>SLNDocument</string>
<key>NSPersistentStoreTypeKey</key>
<string>SQLite</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>slncacheitem</string>
</array>
<key>CFBundleTypeMIMETypes</key>
<array>
<string>text/xml</string>
</array>
<key>CFBundleTypeName</key>
<string>Cached Item</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSItemContentTypes</key>
<array>
<string>com.selene.slnavigator.slncacheditem</string>
</array>
<key>LSTypeIsPackage</key>
<false/>
</dict>
</array>
...
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>SLNavigator database</string>
<key>UTTypeIdentifier</key>
<string>com.selene.slnavigator.slndatabase</string>
<key>UTTypeReferenceURL</key>
<string>http://www.selene.com/slnavigator/slndatabase</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>slndb</string>
</array>
</dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.content</string>
</array>
<key>UTTypeDescription</key>
<string>SLNavigator cached item</string>
<key>UTTypeIconName</key>
<string></string>
<key>UTTypeIdentifier</key>
<string>com.selene.slnavigator.slncacheditem</string>
<key>UTTypeReferenceURL</key>
<string>http://www.selene.com/slnavigator/cacheditem</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>slncacheitem</string>
</array>
</dict>
</dict>
</array>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden