Saturday, January 19, 2008

Change the default app for PDFs in Firefox on Mac

So I've been using OSX now for six months, and one thing that's always bugged me is that Firefox (Fx) insists upon opening PDFs with Preview, despite me telling it otherwise every time it's presented an option. What I want it to do is use Skim as the default. The preferences pane in Fx is no help (using v 2.0.0.11), as there is no entry for PDF in the download actions pane, and no option to add one either. I finally decided "there has to be a way" this morning, and a little googling later found that Fx stores the download actions in your profiles folder, in mimeTypes.rdf My brute force hack follows: 1. Close Fx 2. Make a backup copy of mimeTypes.rdf :-) 3. Find the entry that looks like this:
<RDF:Description RDF:about="urn:mimetype:handler:application/pdf"
                 NC:alwaysAsk="false"
                 NC:useSystemDefault="true"
                 NC:saveToDisk="false">
  <nc:externalapplication resource="urn:mimetype:externalApplication:application/pdf">
</RDF:Description>
and add an attribute to the RDF:Description element:
  NC:handleInternal="false"
so that you end up with this:
<RDF:Description RDF:about="urn:mimetype:handler:application/pdf"
                 NC:alwaysAsk="false"
                 NC:useSystemDefault="true"
                 NC:saveToDisk="false"
                 NC:handleInternal="false">
  <nc:externalapplication resource="urn:mimetype:externalApplication:application/pdf">
</RDF:Description>
By the way, if the other attribute values aren't the same as above, you probably want to change them to look like above. Just a guess. 4. Find the element that looks like this:
  <RDF:Description RDF:about="urn:mimetype:externalApplication:application/pdf"
                   NC:prettyName=""
                   NC:path="" />
and add the prettyName and path to Skim, resulting in this:
  <RDF:Description RDF:about="urn:mimetype:externalApplication:application/pdf"
                   NC:prettyName="Skim.app"
                   NC:path="/Applications/Skim.app" />
5. Save mimeTypes.rdf and done! Now go find a PDF and enjoy its opening-by-default-in-skimmy-goodness!

No comments: