How to associate MIME type with a handler in OS X?











up vote
4
down vote

favorite












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















up vote
4
down vote

favorite












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













up vote
4
down vote

favorite









up vote
4
down vote

favorite











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










share|improve this question















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







macos mime-types






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 8 '12 at 6:58









slhck

157k46434461




157k46434461










asked May 8 '12 at 1:16









JAM

219149




219149












  • 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


















  • 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
















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




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




So that it's handled by some application, see my answer @DavidSchwartz
– slhck
May 8 '12 at 6:59










2 Answers
2






active

oldest

votes

















up vote
5
down vote













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










  • Awesome answer... Wondering if you were aware of which apps might add in this way? I see none in my LSHandlers that use this format.... Is that because LSHandlerContentType (with values like "public.css" instead of "text/css") is preferred for this? ( apple.stackexchange.com/a/9883/206073 seems to suggest such a preference, at least in the case of comparing LSHandlerContentType to the "public.filename-extension" LSHandlerContentTagClass)
    – Brett Zamir
    Jun 20 at 4:50












  • Latter question now asked at apple.stackexchange.com/questions/328325/…
    – Brett Zamir
    Jun 21 at 2:12






  • 1




    @BrettZamir Good question – that's beyond my knowledge. It could also be that the default has been changed in the meantime (my answer is from 2012).
    – slhck
    Jun 21 at 5:33


















up vote
0
down vote













To view mime-type of a file in terminal:



file --mime-type -b file-name





share|improve this answer





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f421792%2fhow-to-associate-mime-type-with-a-handler-in-os-x%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    5
    down vote













    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










    • Awesome answer... Wondering if you were aware of which apps might add in this way? I see none in my LSHandlers that use this format.... Is that because LSHandlerContentType (with values like "public.css" instead of "text/css") is preferred for this? ( apple.stackexchange.com/a/9883/206073 seems to suggest such a preference, at least in the case of comparing LSHandlerContentType to the "public.filename-extension" LSHandlerContentTagClass)
      – Brett Zamir
      Jun 20 at 4:50












    • Latter question now asked at apple.stackexchange.com/questions/328325/…
      – Brett Zamir
      Jun 21 at 2:12






    • 1




      @BrettZamir Good question – that's beyond my knowledge. It could also be that the default has been changed in the meantime (my answer is from 2012).
      – slhck
      Jun 21 at 5:33















    up vote
    5
    down vote













    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










    • Awesome answer... Wondering if you were aware of which apps might add in this way? I see none in my LSHandlers that use this format.... Is that because LSHandlerContentType (with values like "public.css" instead of "text/css") is preferred for this? ( apple.stackexchange.com/a/9883/206073 seems to suggest such a preference, at least in the case of comparing LSHandlerContentType to the "public.filename-extension" LSHandlerContentTagClass)
      – Brett Zamir
      Jun 20 at 4:50












    • Latter question now asked at apple.stackexchange.com/questions/328325/…
      – Brett Zamir
      Jun 21 at 2:12






    • 1




      @BrettZamir Good question – that's beyond my knowledge. It could also be that the default has been changed in the meantime (my answer is from 2012).
      – slhck
      Jun 21 at 5:33













    up vote
    5
    down vote










    up vote
    5
    down vote









    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














    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














    share|improve this answer



    share|improve this answer








    edited May 8 '12 at 14:57

























    answered May 8 '12 at 6:58









    slhck

    157k46434461




    157k46434461












    • 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










    • Awesome answer... Wondering if you were aware of which apps might add in this way? I see none in my LSHandlers that use this format.... Is that because LSHandlerContentType (with values like "public.css" instead of "text/css") is preferred for this? ( apple.stackexchange.com/a/9883/206073 seems to suggest such a preference, at least in the case of comparing LSHandlerContentType to the "public.filename-extension" LSHandlerContentTagClass)
      – Brett Zamir
      Jun 20 at 4:50












    • Latter question now asked at apple.stackexchange.com/questions/328325/…
      – Brett Zamir
      Jun 21 at 2:12






    • 1




      @BrettZamir Good question – that's beyond my knowledge. It could also be that the default has been changed in the meantime (my answer is from 2012).
      – slhck
      Jun 21 at 5:33


















    • 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










    • Awesome answer... Wondering if you were aware of which apps might add in this way? I see none in my LSHandlers that use this format.... Is that because LSHandlerContentType (with values like "public.css" instead of "text/css") is preferred for this? ( apple.stackexchange.com/a/9883/206073 seems to suggest such a preference, at least in the case of comparing LSHandlerContentType to the "public.filename-extension" LSHandlerContentTagClass)
      – Brett Zamir
      Jun 20 at 4:50












    • Latter question now asked at apple.stackexchange.com/questions/328325/…
      – Brett Zamir
      Jun 21 at 2:12






    • 1




      @BrettZamir Good question – that's beyond my knowledge. It could also be that the default has been changed in the meantime (my answer is from 2012).
      – slhck
      Jun 21 at 5:33
















    Is there a way to do the same from the command line? Possibly by editing mime.types?
    – JAM
    May 8 '12 at 13:38




    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




    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












    Awesome answer... Wondering if you were aware of which apps might add in this way? I see none in my LSHandlers that use this format.... Is that because LSHandlerContentType (with values like "public.css" instead of "text/css") is preferred for this? ( apple.stackexchange.com/a/9883/206073 seems to suggest such a preference, at least in the case of comparing LSHandlerContentType to the "public.filename-extension" LSHandlerContentTagClass)
    – Brett Zamir
    Jun 20 at 4:50






    Awesome answer... Wondering if you were aware of which apps might add in this way? I see none in my LSHandlers that use this format.... Is that because LSHandlerContentType (with values like "public.css" instead of "text/css") is preferred for this? ( apple.stackexchange.com/a/9883/206073 seems to suggest such a preference, at least in the case of comparing LSHandlerContentType to the "public.filename-extension" LSHandlerContentTagClass)
    – Brett Zamir
    Jun 20 at 4:50














    Latter question now asked at apple.stackexchange.com/questions/328325/…
    – Brett Zamir
    Jun 21 at 2:12




    Latter question now asked at apple.stackexchange.com/questions/328325/…
    – Brett Zamir
    Jun 21 at 2:12




    1




    1




    @BrettZamir Good question – that's beyond my knowledge. It could also be that the default has been changed in the meantime (my answer is from 2012).
    – slhck
    Jun 21 at 5:33




    @BrettZamir Good question – that's beyond my knowledge. It could also be that the default has been changed in the meantime (my answer is from 2012).
    – slhck
    Jun 21 at 5:33












    up vote
    0
    down vote













    To view mime-type of a file in terminal:



    file --mime-type -b file-name





    share|improve this answer

























      up vote
      0
      down vote













      To view mime-type of a file in terminal:



      file --mime-type -b file-name





      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        To view mime-type of a file in terminal:



        file --mime-type -b file-name





        share|improve this answer












        To view mime-type of a file in terminal:



        file --mime-type -b file-name






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 14 at 13:22









        Mostafiz Rahman

        1093




        1093






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f421792%2fhow-to-associate-mime-type-with-a-handler-in-os-x%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Probability when a professor distributes a quiz and homework assignment to a class of n students.

            Aardman Animations

            Are they similar matrix