Add a document type

Supported file types and extensions are registered in the Info.plist file. Everything you read will say to edit that file directly, but there is a better way. Quoting the Q&A page: To add the document type do the following:

  1. In your Xcode project, select the target you want to add the document type to.
  2. Select the Info tab.
  3. Click on the disclosure button for Document Types to open the document types.
  4. Click the “+” button.
  5. In the newly created document type :
    • Type the name of the document type.
    • In the “Types” section fill in the UTI for the new type.
    • Provide an icon for the document.
  6. Click the disclosure triangle to open Additional document type properties.
  7. Click in the table to add a new key and value.
    • For the key value type: CFBundleTypeRole.
    • For the value type: Editor.
  8. Click the + button to add another key/value pair.
    • For the key value type: LSHandlerRank.
    • For the value type: Owner.

Theres more on that same page:

  • Adding a custom UTI. If it’s a custom UTI you need to add it. This is how you associate file extensions with the UTI.
  • How to test (hint: send the document as email)
  • Troubleshooting

Also look at the original documentation, though it doesn’t mention how XCode can help. See: Registering the File Types Your App Supports and Uniform Type Identifiers.

Detailed info keys for document file types: CFBundleDocumentTypes

h/t