Declaring New Uniform Type Identifiers

Mac apps can add new uniform type identifiers for proprietary data formats. You declare new UTIs in the information property list (info.plist) file of a bundle. You can declare new UTIs in any of the following:

Declaring UTIs

In addition to declaring the UTI string, the declaration can contain any of the following properties:

Your UTI declarations must be either imported or exported:

If both imported and exported declarations for a UTI exist, the exported declaration takes precedence over imported one.

Here is a sample declaration for the public.jpeg UTI, defined as an exported type, as you would find in a property list:

 <key>UTExportedTypeDeclarations</key>
        <array>
            <dict>
                <key>UTTypeIdentifier</key>
                <string>public.jpeg</string>
                <key>UTTypeReferenceURL</key>
                <string>http://www.w3.org/Graphics/JPEG/</string>
                <key>UTTypeDescription</key>
                <string>JPEG image</string>
                <key>UTTypeIconFile</key>
                <string>public.jpeg.icns</string>
                <key>UTTypeConformsTo</key>
                <array>
                    <string>public.image</string>
                    <string>public.data</string>
                </array>
                <key>UTTypeTagSpecification</key>
                <dict>
                    <key>com.apple.ostype</key>
                    <string>JPEG</string>
                    <key>public.filename-extension</key>
                    <array>
                        <string>jpeg</string>
                        <string>jpg</string>
                    </array>
                    <key>public.mime-type</key>
                    <string>image/jpeg</string>
                </dict>
            </dict>
        </array>

Table 3-1 shows a list of the available property key lists that you use in UTI declarations.

Table 3-1  Property list keys for uniform type identifiers

Key

Value type

Description

UTExportedTypeDeclarations

array of dictionaries

An array of exported UTI declarations (that is, identifiers owned by the bundle’s publisher).

UTImportedTypeDeclarations

array of dictionaries

An array of imported UTI declarations (that is, identifiers owned by another company or organization).

UTTypeIdentifier

string

The UTI for the declared type. This key is required for UTI declarations.

UTTypeTagSpecification

dictionary

A dictionary defining one or more equivalent type identifiers.

UTTypeConformsTo

array of strings

The UTIs to which this identifier conforms.

UTTypeIconFile

string

The name of the bundle icon resource to associate with this UTI.

UTTypeDescription

string

A user-visible description of this type (may be localized).

UTTypeReferenceURL

string

The URL of a reference document describing this type.

Recommendations for Declaring new Uniform Type Identifiers

If your application uses proprietary data formats, you should declare them in the Info.plist file of your application bundle. Some guidelines: