How does Apple associate file type with (external) applications?

Solution 1:

You can find a work-around described here:

https://www.cnet.com/news/how-to-clear-custom-application-associations-in-os-x/

The steps required are:

  1. Locate a .tex file on your system in the Finder and press Cmd-i to open the info window

  2. In the "Open With" section, you'll see a drop-down. Choose "Other" and then select the built-in Calculator.app to open the file with. This is done as Calculator.app does not support opening any document type.

  3. In the info window press "Change All..." so that all .tex files becomes associated with Calculator.app.

  4. If you try opening a .tex file now, you'll get an error saying that Calculator.app cannot open this file type.

  5. Open Terminal.app and run the following command:

    $(locate lsregister | grep '^\/System') -u /Applications/Calculator.app
    

This command first finds the lsregister program on your system, and then runs it to unregister (i.e. clear any document type associations) for the Calculator.app.

Now when you open .tex files, you'll be presented with the default popup saying that the file cannot be opened, and you'll be asked to choose an application to open it with.