Action to change default application to handle a given filetype on MacOS?

Hi there,

As part of some of my macros I would like to be able to change the default application that handles a given filetype (eg, PDF) on MacOS. Any ideas on how to achieve this through KM?

Thanks in advance,
Bruno

Hey Bruno,

Look here:

Setting default Open With for file types

-Chris

Hi Chris,

This seems like the perfect solution!

Created a "Execute swift script" action to change my Mac's PDF default handling to Acrobat Pro:

import Foundation

LSSetDefaultRoleHandlerForContentType("com.adobe.pdf" as CFString, LSRolesMask.all, "com.adobe.Acrobat.Pro" as CFString)

After running the macro, however, Preview still opens PDFs when I click them on Finder... Do you please know what might be wrong? I'm on KM 8.2.4 / macOS 10.13.6 (High Sierra).

Thanks a ton!

Bruno

Bruno, I have replied in the original thread where you have posted the same question.

1 Like