Identifying file types: UTIs, filename extensions, and another free app

macOS, like classic Mac OS before it, is generally very good at recognising the types of different files and other components. It does so using a combination of different systems: the extension given to a file name is important, it still recognises Classic Mac OS file type designators consisting of four characters (like APPL for an application), and it supports other systems too. The most important and precise of these are Apple’s own Uniform Type Identifiers (UTI), like public.text for a basic text file.

Unfortunately, Apple’s reference manual of UTIs is now nearly nine years out of date. When I was developing Scrub, I realised that there is no more recent compilation of current UTIs, nor any conversion tables between UTIs and other systems such as filename extensions.

The first consquence is that I have built a new version of Precize, which includes the UTI among the information which it provides about files.

precize51

Precize version 1.3 for El Capitan, Sierra, High Sierra, and Mojave is now available from here: precize13
and from Downloads above.

Getting UTIs for individual items is all very well, but doesn’t address the problem of how to discover current UTIs, and how to convert between different systems. For that, I looked high and low to try to discover where macOS keeps its own tables, for use primarily by LaunchServices. I was looking for a needle in a very large haystack, and for the moment have drawn a blank.

My solution is another app, which I put together quickly yesterday into a first beta release. It’s not particularly smart at present, and doesn’t yet have its own icon, but does the job.

I wanted two main features: first to be able to scan folders and discover which UTIs are used in them, so that I can build a list, and eventually build them into their tree hierarchy. The other was to be able to convert freely between the different type systems. In this app, you can type in any one of:

  • UTI, e.g. com.adobe.pdf,
  • filename extension, e.g pdf,
  • OSType, e.g. PDF,
  • MIME type, e.g. application/pdf, or
  • Pasteboard type, e.g. Apple PDF pasteboard type.

Press return, and all the information of those other type designators is given. UTIutility also lists the UTIs to which that type ‘conforms’, meaning the more general types of which it is a member. In the case of PDF, for example, those are public.data and public.composite-content.

utiutil01

Its Crawler window displays the list of UTIs which it has found in a selected folder, during an exhaustive search of its files and folders. If there is sufficient interest in UTIutility, I intend using this to build its own database, which will make it easier to examine individual UTIs.

utiutil02

The main window then displays all the different types, and the UTIs to which it conforms.

UTIutility 1.0b1 is available from here: utiutil10b1
and in Downloads above, and runs on El Capitan, Sierra, High Sierra, and Mojave.

If you find this useful, please let me know and I will press on with developing it further.