Sign up ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

In, you can hit Enter to edit the name of the currently selected file or folder.

OS X will automatically select only the file name part, not the extension:

This is very useful, because that way you can just start typing the new name, without worrying about accidentally changing the file extension.

However, this only seems to work for “known” file types. If you try it with an unknown extension, the whole file name (including the extension) gets selected:

I tried mapping an application that can open all .bar files via +I → “Change All”, but I still get the behavior described above.

Where is the list of “known” file types stored? Is there a way to make OS X recognize new file types?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

This SuperUser post worked for me:

You need to browse to the application that you’d like to use to open these files, and edit its bundle. Right-click the application to handle these file extensions and select Show Package Contents. Navigate to Contents, and edit Info.plist. You might need Property List Editor, which is part of Apple’s developer tools. If you’re lucky, it’s in XML format. Edit this file’s CFBundleDocumentTypes and add an entry for the extension that you want.

I used TextEdit as the default application to open .bar files. The only thing I did differently was change the XML that went in TextEdit’s Info.plist to:

        <string>Bar Document</string>

…and then I used to refresh TextEdit in the launch services database. Then it worked as you suggested, although it will probably break the code signature of Textedit (and any other signed application) on Lion.

share|improve this answer
CFBundleTypeExtensions is a legacy key which became deprecated in OS X 10.5. The preferred method since 2007 is to declare new UTIs, as mentioned here and described in my answer. –  TachyonVortex Mar 4 at 22:48

UTIs and Launch Services

Where is the list of “known” file types stored?

The official term for "file types" is Uniform Type Identifiers (UTIs), and the database of UTIs is maintained by Launch Services.

Using the Terminal, you can view the contents of the Launch Services database using the lsregister tool, which is stored at:


Instead of specifying that long path every time you want to run lsregister, you can temporarily add its directory to your PATH:


and then you can run lsregister by simply entering:


To view the contents of the Launch Services database:

lsregister -dump

Declaring New UTIs

Is there a way to make OS X recognize new file types?

This Apple article, "Declaring New Uniform Type Identifiers", provides useful information on how to do this. Here's the complete process:

1. Create a dummy application

Create a dummy application to register with Launch Services:

  • Open AppleScript Editor (located in OS X's Utilities folder).
  • Save a new empty script somewhere (eg: on your Desktop), setting its File Format to Application.

2. Open its Info.plist file

  • Locate your new dummy application in the Finder.
  • Right-click on it, and select Show Package Contents from the popup menu.
  • Open its Contents folder.
  • Open the Info.plist file in a text editor (eg: TextEdit).

3. Add your new UTI

There's a choice of two keys:

  • UTExportedTypeDeclarations – for your own custom filename extensions.
  • UTImportedTypeDeclarations – for filename extensions which already exist but aren't recognised by OS X.

Choose the key which is most appropriate for your needs.

Then in the Info.plist file, before the final two lines (</dict></plist>), add this code:


making the following changes:

  • Replace KEY with your chosen key (either UTExportedTypeDeclarations or UTImportedTypeDeclarations).
  • Replace IDENTIFIER with a suitable reverse-DNS identifier:
    • Exported – Something like com.mycompany.mytype
    • Imported – For id Software's Doom WAD format, a suitable identifier would be com.idsoftware.wad
  • Replace EXTENSION with the filename extension (without the leading dot), eg: wad.

This is the minimum code necessary for Launch Services to accept your new UTI. You can also add the following optional properties:

  • UTTypeConformsTo – See the Appendix below.
  • UTTypeDescription – A user-visible description, which will be displayed in the Finder.
  • UTTypeIconFile – If you add an Apple Icon Image file to the Contents/Resources folder in your dummy application, and add its filename in this property, then files which have your new filename extension will use this icon.
  • UTTypeReferenceURL – The URL of a reference document describing this type.

Here's a complete example showing all the optional properties:

        <string>Doom WAD file</string>

4. Register your new UTI with Launch Services

Run this command in the Terminal:

lsregister <PATH_TO_APP>

replacing <PATH_TO_APP> with the path to your dummy application, eg:

lsregister ~/Desktop/

If you now create a file with your new filename extension, and then select it in the Finder and hit Enter, the Finder should automatically select only the filename part, not the extension.

If you view the contents of the Launch Services database:

lsregister -dump

you should find your new UTI listed:

type    id:            50364
        bindableKey:   12608
        generation:    1
        uti:           com.idsoftware.wad
        description:   Doom WAD file
        flags:         imported  active  apple-internal  untrusted
        icon:          DoomWAD.icns
        conforms to:
        tags:          .wad

If you later want to unregister your new UTI, pass the -u option to lsregister:

lsregister -u ~/Desktop/

Appendix: UTI hierarchy and conformance

OS X declares a hierarchy of UTIs which are listed here: System-Declared Uniform Type Identifiers.

Here are a few UTIs in the hierarchy:

  • public.content
    • public.text
      • public.rtf
      • public.html
      • public.xml
      • public.plain-text
      • public.source-code
        • public.c-source
        • public.c-header
    • public.image
      • public.jpeg
      • public.tiff
      • public.png
    • public.audiovisual-content

Each UTI "conforms to" its parent UTI:

For example, the UTI public.html, which defines HTML text, conforms to the base text identifier, public.text. In this case, conformance lets applications that can open general text files identify HTML files as ones it can open as well. (ref)

When creating a new UTI, it's a good idea to set the UTTypeConformsTo property to one of the existing UTIs.

For example, if your new UTI is a type of source code, then you should set the UTTypeConformsTo property to public.source-code, so that it can be opened by any applications which can open public.source-code or public.plain-text or public.text files.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.