0

I have texlive and texshop for Latex on my external SSD. I deleted my Library preference files for both apps along with a lsregister -kill command to force my Mac to forget all non-default pathing.

But somehow Mac still recognizes to associate .tex file types as a Latex file. Reason I know this is because when I have my SSD unplugged, my .tex file shows the unknown application file icon but as soon as I plug my SSD, the file icon changes to a Latex file icon.

How can I force my Mac to forget all file associations except the default file types (e.g., .pdf, .txt, etc)? I'd like to see a 'Cannot open this file' window when I click a .tex file.

2

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.

2
  • locate lsregister may return several lines :-) – nohillside Apr 22 '17 at 8:49
  • You're right :-) – jksoegaard Apr 22 '17 at 8:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .