Quickly Open PDFs in Specific Apps

When I want to read PDFs using text-to-speech, I want PDFSpeech to be the default application for opening PDFs. Then, I simply double-click on a PDF in Finder and it will open in PDFSpeech, ready to read. Later, I change the default app for PDFs back to Preview, which is my preferred editor for PDFs.

The usual way to change the default application to open PDFs on macOS, is to select any PDF in Finder, then use CMD i for the Inspector, and in the "Open with" section, select the application from the provided list. However, with so many PDF-compatible applications available on a Mac, it may take a while to populate this drop-down list of eligible applications. And thus changing the default application for opening PDFs this way may be too slow.

Instead, you can use the duti command-line utility, available through Homebrew (which provides an elegant way to add command-line utilities to your Mac.)
* Click for instructions on how to install Homebrew on your Mac.

After Homebrew is installed, run the following command to install duti (this is a one-time setup):

brew install duti

Then, whenever you want to switch to PDFSpeech, run the following command in Terminal:

duti -s me.onekerato.PDFSpeechMAS com.adobe.pdf viewer

To revert to Preview, the command is:

duti -s com.apple.Preview com.adobe.pdf all

Similarly, if you want to open several PDFs in PDFOutliner to add or edit their table of contents, make PDFOutliner the default app for PDFs using the command:

duti -s me.onekerato.pdfoutliner com.adobe.pdf all

To open PDFs in Skim, an excellent utility for annotating PDFs, change the default app to Skim with the command:

duti -s net.sourceforge.skim-app.skim com.adobe.pdf all

To open PDFs in PDFoo for linking to sections and figures in PDFs, make PDFoo the default app for opening PDFs using the command:

duti -s me.onekerato.PDFoo com.adobe.pdf viewer

The idea is to get your work done, and then revert to Preview or any other favorite PDF editor.

To see the current default app for any filetype, such as the pdf extension, use this code:

duti -x pdf