When I change a file extension in Finder.app, I get prompted for confirmation.
How can I disable all of these? I always want to confirm the change.
Best Answer
In Finder go to the "Finder" menu and select Preferences.
Click on the "Advanced" tab.
Either Check or Uncheck "Show warning before changing an extension" depending on the behavior you want.
Note that it is not possible to change what the default action is (EG press Enter for [respectively] "Remote" , "Don't Add" , "Keep .png"). That is baked in to macOS as a default action. This is always going to be the action that will potentially NOT make a change that could cause a potential issue.
There is not a safe and advisable way to achieve what you are after because this function of the OS is controlled by the Launch Services database. Developers register the filetypes their applications support with the OS on first launch.
The best way to get this fixed is to petition the developer to add support for the file extension in a future version of their application.
With that said you have already found the only documented way that Apple offers for overriding the edicts of the Launch Services database. If you want to dig deeper and take the road less traveled supported here are a few pointers.
There is a .plist file that governs part of what Launch Services does located at: ~/Library/Preferences/com.apple.LaunchServices.plist
Apple notes that removing this plist can clear out unwanted Open With contextual menu options. But that's the opposite of what you're after.
It's a binary .plist but you could convert it to an xml version and experiment a little to see if you can come up with a recipe to achieve what you're after. This isn't advisable, it could cause harm, and it will most likely get overwritten by the OS at some point.
There is also a tool hidden a bit deeper in the OS called lsregister which could be helpful in exploring Launch Services's plumbing. Here is a helpful explanation of lsregister and its options.
You need to browse to the application that you’d like to use to open these files, and edit its bundle. Right-click the application to handle these file extensions and select Show Package Contents. Navigate to Contents, and edit Info.plist. You might need Property List Editor, which is part of Apple’s developer tools. If you’re lucky, it’s in XML format. Edit this file’s CFBundleDocumentTypes and add an entry for the extension that you want.
I used TextEdit as the default application to open .bar files. The only thing I did differently was change the XML that went in TextEdit’s Info.plist to:
…and then I used LSRefresh.app to refresh TextEdit in the launch services database. Then it worked as you suggested, although it will probably break the code signature of Textedit (and any other signed application) on Lion.
Best Answer
In Finder go to the "Finder" menu and select Preferences. Click on the "Advanced" tab. Either Check or Uncheck "Show warning before changing an extension" depending on the behavior you want.
Note that it is not possible to change what the default action is (EG press Enter for [respectively] "Remote" , "Don't Add" , "Keep .png"). That is baked in to macOS as a default action. This is always going to be the action that will potentially NOT make a change that could cause a potential issue.