How to make a particular app the default viewer / editor for ALL its supported file types at once?
I want to make an application, say VLC, the default player for all the file types it supports, without going through all of them individually.
I might not even know what all the supported formats are (as VLC can read 100s of formats) and still want to set it as the default player for all of them.
I was able to do this using the terminal, with the procedure posted below.
Is there an easier way to do it that doesn't require the user to be a developer?
While RCDefaultApp is a bit old, it still works
This gives you a decent GUI interface to control default apps
- Find the application's
Info.plist
file and convert it to xml format if needed.
VLC's plist file is already in xml format, otherwise you'd have to do:plutil -convert xml1 /Applications/VLC.app/Contents/Info.plist
- Perform the necessary dark magic to extract the list of supported file extensions, with your preferred wand (here is awk, but sed, perl, and others would work just as well):
awk '/CFBundleTypeExtensions/{t=1} /<\/array>/{t=0} t&&/<string>/{gsub(/\t*<\/?string>/,"");print}' /Applications/VLC.app/Contents/Info.plist
- Check the output to make sure you really got the list of extensions and that you really want to associate all those types with the app.
- Recall the last command ▲ and edit it in order to create an empty file in your current directory for every file extension in the list:
for i in $( ≪awk command as before≫ ); do touch dummy.$i; done
- Open your home folder in the Finder, select all the "dummy" files and open a collective inspector for all of them: option+command+i
- Set the application in Open With and use the Change All button.
- Trash the dummy files.