Is there a way to hide all file extensions in OS X?

I use Hazel with an applescript to keep my filename extensions hidden. Hazel is just a way to make sure that anytime I create a new file, the applescript gets run on it. The applescript is pretty easy -- you can see all three lines of it in the screenshot below. I also like to set the color labels by file type, thus the selection of only PDFs and the red color labels. You can skip both of those if you like.

enter image description here

Just to be clear, you don't need to use Hazel. You could use folder actions or an automator workflow to initiate the applescript on the files you want to change.


In the Finder, selected the Preferences menu item from the Finder menu. Click the Advanced Tab. Make sure to un-check Show all filename extensions. Close the window.

Finder Preferences

I had thought this was unset by default, but perhaps not.


The only correct answer is that you should not be doing what you are trying to do.

Hidden file extensions is a serious security hole. If you allow file extensions to be hidden, someone can create an application and name it:

MyFile.pdf.app

and on your machine, you will see a file named:

MyFile.pdf

possibly even with a PDF icon. Your first thought will not be, "Why is the extension showing?" but rather, "Oh, that's just a PDF file. It's safe to open it." And that's when your machine becomes a zombie in a botnet.

You should always leave the "Show all filename extensions" checkbox checked. It's really the only way to be completely safe from those sorts of trojans.