Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
How to Change File Type Associations?

Every time I get a machine that I install XCode on, it associates itself with all kinds of filetypes. E.g., .xml, .rb, even .java! It's such a nuisance to have to re-associate those file extensions individually. If I want to open XCode, I'll open XCode, but I never want to open XCode by double-clicking on a script or using open.

Is there any way to globally disassociate XCode from all file types? More generally, is there any way to do this for any app (e.g., QuickTime)?

share|improve this question

marked as duplicate by bassplayer7, patrix, BinaryMisfit, Mark, jmlumpkin Jan 23 '13 at 14:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

You could delete the CFBundleDocumentTypes array in the Info.plist, but it is also used to define file types like xcodeproj. It would also invalidate the code signature (so you'd have to enter a password to access keychains), and the changes might get overridden by updates. Some applications like TextEdit crash on launch if the Info.plist is modified.

To update the Launch Services database, run /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -R -f /Applications/

You could also unregister the application by running lsregister -u -R -f /Applications/, but I don't know if it would get registered again at some point. It would also remove the icons of file types defined by the application.

If you are looking for a faster way to change default applications, take a look at duti. I have published my configuration file (which includes common code and video file types) here.

share|improve this answer
+1 for duti. That is a step in the right direction. – Tobia May 25 '13 at 10:21

Actually, I don't think you can.

See, OS X make the association by looking into the application's plist file. So you either have to edit that plist file or made changes to the way it detects file type association.

There MIGHT be ways to directly manipulate the database, but it might be too difficult. So try this:

Right click (control-click) on the file belonging to the file type you want to open, and as the contextual menu shows up, hold option. You will see "Always Open With", it won't disassociate, but it will change its priority.

share|improve this answer
I tried this on Yosemite trying to get sublime text 2 to open a source file instead of xcode. sadly it didn't work. Shame, because this would have been convenient and easy to remember. – ThinkBonobo Jun 26 '15 at 1:02
@ThinkBonobo (and all web search arrivals) In Yosemite, you need to Get Info on the file, then select the desired application in the drop-down menu and press "Change All..." in order to get this behavior. "Always open with" only applies to the single file. – reve_etrange Sep 17 '15 at 23:28
I had discovered how since but failed to report it. thanks for catching that. – ThinkBonobo Sep 18 '15 at 4:48

The only way I can think of doing this is by going to the individual file types and right clicking and going to get info, going down to open with, and clicking the program you want to use and clicking change all.

Another way to do this is by right clicking, and holding option and going to always open and clicking the program you want to use

Hope This Helps

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.