File logo

Bill, I’ve got one here and will get it for you when I get to my desk, but if you are doing this, it’s really important that you understand what you are doing and how it works. Otherwise, you’re setting yourself up for pain later.

UTI stands for Uniform Type Identifier. It is meant to be unique for this particular type across all apps everywhere. This is why I suggested BundleID + type name.

The Extension is used for the file system to know which UTI to apply when a file is created by your app.

Now the UTI structure is hierarchical, which means that it can “conform to” other types above it. The base of which is determined by the type (on the right) of File, Folder or Package (a folder that looks like a file in Finder). Here I was suggesting public.database because that would allow other database editors to open your sqlite file through drag and drop or right clicking and selecting Open > some other app.

Role determines the role that your application takes in terms of this file. If your app can edit the file (or creates them) this should be Edit. Otherwise you can choose Execute (if the file represents a script of some kind), View (if your app could display PDFs but not edit them for instance) or None (if your app can open a file type but it isn’t its main function).

Rank determines how high up in the Open menus that your app will appear. Owner means “I own and create these files” which is what you’ll use in this case. Other possible values are Default which means “if there’s no owner, the user should choose me”, Alternate which means “I’m not the first app a user would choose, but if there aren’t any others, I can open it” and None which means “I can open this file, but don’t show my app in any of the menus or dialogs”.

Here’s an example of how you might set one up…

Just remember that you can only use ascii letters, hyphens and periods. Here’s what Apple says about this:

The identifier must contain only alphanumeric characters ( a - z , A - Z , and 0 - 9 ), hyphens ( - ), and periods ( . ). For example, you might use com.company.greatAppDocument or com.company.greatApp-document

2 Likes