Every once in a while, my mac will forget its file associations as well things like default browser, email client, etc. This is super frustrating. What I’ve done in the past was simply set all my file associations back the old fashioned way. That means bringing up the Get Info
dialog, picking a new app in the “Open with:” section, and clicking the Change All...
button. This is a slow and laborious process and I’m too damn lazy to do that more than once. Well, I recently lost my file associations yet again, so I became determined to find out a way to restore my lost associations rather than manually associate them all over again.
I figured if I can find the location of where these associations are actually stored on disk, I could simply restore this file from a backup and avoid all the “Get Info” hoopla. This proved pretty difficult at the time of this post. Any and all search variations of “mac os file associations stored”, “file associations location”, “file association path” came up mostly useless. But as is so often the case, a kind samaritan at Stack Exchange pointed me in the right direction.
Lri’s post goes into some awesome detail that may be of use to folks, so please do check it out. However I’m plucking out the part that was important to me, posting it on my blog, and sprinkling in some keywords to help future googlers that simply want to restore their file associations (<- those were some keywords right there!). To me, the most important part is the location of where the dang file associations are stored on disk.
On 10.15 Catalina (this may be the case on other versions, but I can only vouch for 10.15), the file associations are stored in this file:
~/Library/Preferences/com.apple.LaunchServices/com.apple.launchservices.secure.plist
Simply restore that file from a backup (I used Time Machine) and do a full reboot (not just log out and log in). That did the trick for me!