Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can one add a new MIME type in OS X?

share|improve this question
    
It's not clear what you're talking about. Add a new MIME type so that what happens exactly? –  David Schwartz May 8 '12 at 2:12
    
So that it's handled by some application, see my answer @DavidSchwartz –  slhck May 8 '12 at 6:59

1 Answer 1

The easiest would be to download and install RCDefaultApp. Go to System Preferences » Default Apps, then the MIME Types tab.

Enter your new MIME type in the text box below, press the + button, and select your handler.


Via command line, you need to edit the ~/Library/Preferences/com.apple.LaunchServices.plist preference list. In its array of LSHandlers, you need to insert a Dictionary containing your new MIME type as:

  • LSHandlerContentTag – the MIME type
  • LSHandlerContentTagClass, which is public.mime-type
  • LSHandlerRoleAll, which specifies the Bundle ID of the application that handles it, e.g. org.videolan.vlc. You find out the bundle ID by inspecting the .app folder and the Info.plist preference list therein.

share|improve this answer
    
Is there a way to do the same from the command line? Possibly by editing mime.types? –  Jam May 8 '12 at 13:38
    
See my updated answer. Are you talking about apache2/mime.types? Not sure if you're supposed to edit that. Can you elaborate a bit why you need to edit it? What's your context? Without context, it's hard to help you. –  slhck May 8 '12 at 14:59

Your Answer

 
discard

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.