Search code examples
macosmacos-carbonuti

Finder not seeing my UTI


I'm trying to tell OSX's Finder that my email client application can open .eml files and so far it's not going so well. I took a leaf from Mail.app's plist and pretty much copied most of the UTI values straight over, just changing the UTTypeIdentifier to my own company.

The plist as it stands:

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>LSItemContentTypes</key>
        <array>
            <string>com.memecode.scribe.email</string>
        </array>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
        <key>CFBundleTypeIconFile</key>
        <string>Email.icns</string>
        <key>CFBundleTypeName</key>
        <string>Email Message</string>
    </dict>
</array>
<key>UTExportedTypeDeclarations</key>
<array>
    <dict>
        <key>UTTypeIconFile</key>
        <string>Email.icns</string>
        <key>UTTypeConformsTo</key>
        <array>
            <string>public.data</string>
            <string>public.email-message</string>
        </array>
        <key>UTTypeDescription</key>
        <string>Email Message</string>
        <key>UTTypeIdentifier</key>
        <string>com.memecode.scribe.email</string>
        <key>UTTypeTagSpecification</key>
        <dict>
            <key>public.filename-extension</key>
            <string>eml</string>
            <key>public.mime-type</key>
            <string>message/rfc822</string>
        </dict>
    </dict>
</array>

Is there anything obvious that I'm doing wrong here?


Solution

  • Since Mail is declaring a UTI for the .eml extension, I don't think it makes sense to define your own UTI for the same extension. Just use Mail's UTI under LSItemContentTypes. If you want, you could copy Mail's UTI declaration as an imported type.