Mac set default program for file type

broken image
broken image
broken image

If I want the changes to take effect I'll need to restart Launch Services like so: /System/Library/Frameworks/amework/Versions/A/Frameworks/amework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain userĪnd to give credit where credit is due, I learned about this approach from this stackoverflow. To do this I type: defaults write LSHandlers -array-add '' In this case I'll change the default application for all ain-text types. KMDItemContentModificationDate = 04:18:50 +0000 I can find out the content type value for text files by inspecting one of them with mdls: > mdls test.txt KMDItemCFBundleIdentifier = 'com.sublimetext.2' macOS won’t stop you from setting an incompatible app as the default app for a particular file so make sure the app you’re using as the default app for a certain file type can actually open it. I can use mdls to get this information: > mdls /Applications/Sublime\ Text\ 2.app The default apps can be changed any time you like and the change doesn’t require admin rights. Let's say I wanted to change all text files to open in Sublime Text 2.įirst I need the kMDItemCFBundleIdentifier for Sublime Text 2. Launch Services is responsible for default file associations.