Setting Default Open With for File Types

PS:

Alternatively – without any third-party tools – you could execute this as Swift script in KM:

import Foundation

LSSetDefaultRoleHandlerForContentType("com.adobe.pdf" as CFString, LSRolesMask.all, "com.apple.preview" as CFString)

Replace the BundleIdentifier (com.apple.preview in the example script) according to your needs.

Note: You can quickly get the BundleIdentifier of any app by executing this in the Terminal (example):

osascript -e 'id of app "TextEdit"'

Edit (2017-01-07):

Here is a little macro to get the Bundle ID of an app.

3 Likes