X

Addressing OS X file extensions reverting after change

File name extensions are how OS X recognizes file types, and changing the extension is one way to associate a file with a different program. Sometimes, however, changing the file extension does not work.

Topher Kessler MacFixIt Editor
Topher, an avid Mac user for the past 15 years, has been a contributing author to MacFixIt since the spring of 2008. One of his passions is troubleshooting Mac problems and making the best use of Macs and Apple hardware at home and in the workplace.
Topher Kessler
2 min read

While the launch services in OS X use file name extensions to associate files with various applications, generally users do not need to interact with these extensions and the system keeps them hidden by default; however, you can have the extensions shown, either globally or for specific files. If you edit the extension the system should prompt you for confirmation and then change the extension, but sometimes the system may revert the file name back or continually append the old file name to the new one.

For example, if you have a script file such as a JavaScript routine that you have saved in a plain text format (.txt), you can change its extension to ".js" so various applications will properly identify it as a JavaScript file. However, in some instances if you edit the file name and change the file name to "script.js" then the system may tack on the old extension so the name ends up being "script.js.txt."

To get around this problem, first try getting information about the file to make sure its extension is not hidden. Click the file and press Command-I (or right-click it and choose Get Info) and make sure the Hide Extension check box in the Name & Extension section is unchecked. Optionally, you can try changing the file name from within the Info window.

File extension management options
The Finder's file name extension management options can be found in the File Information window (left) or Finder Preferences (right).

If modifying the file directly does not work, try changing the Finder's preferences for managing file extensions before editing the file. Go to the Finder menu and choose Preferences, and then check the box to show all file name extensions before trying to modify the file name in the Finder. When the file has been edited, revert the extension management settings back to what you prefer.



Questions? Comments? Have a fix? Post them below or e-mail us!
Be sure to check us out on Twitter and the CNET Mac forums.