Set File Associations in Mac OS X Lion: Always Open With
In this article
- Background: How Mac OS X Lion Handles File Associations
- How to Set "Always Open With" in Lion
- Using the Context Menu: Quick "Open With"
- Common Problems and How to Fix Them
- Resetting Launch Services (The Nuclear Option)
- Alternatives: Third-Party Tools and Other Methods
- Safety and Precautions
- Frequently Asked Questions
Yes, you can easily set file associations in Mac OS X Lion using the "Always Open With" option in the Get Info window. This lets you choose which application opens a file type by default, and it works for individual files or all files of that type. Below is a complete guide to setting and managing file associations in Lion, including how to change defaults, fix common problems, and use alternatives.
Background: How Mac OS X Lion Handles File Associations
Mac OS X Lion (10.7) uses a system called Launch Services to decide which application opens a file when you double-click it. Each file has a file type (like .jpg, .pdf, or .txt) and a default application associated with that type. Launch Services stores these associations in a database, and it also tracks which application you last used to open a file. This means that if you open a .txt file with TextEdit once, Lion may automatically set TextEdit as the default for all .txt files, unless you explicitly change it.
The system is designed to be user-friendly, but it can be confusing when a file opens in the wrong app. For example, a PDF might open in Preview instead of Adobe Reader, or an image might open in Photos instead of a dedicated editor. Understanding how to control these associations is key to a smooth workflow.
How to Set "Always Open With" in Lion
The most direct method is through the Get Info window. Here are the steps:
- Right-click (or Control-click) the file you want to change.
- Select Get Info from the context menu. The Info window opens.
- In the Info window, find the section labeled Open with. It shows the current default app.
- Click the dropdown menu and choose the application you want to use. If it's not listed, select Other... and browse to the app in the Finder.
- After selecting the app, click the Change All... button that appears below the dropdown. This makes the new app the default for all files of that type.
- Confirm the change in the dialog that appears, then close the Info window.
If you only want to change the association for that single file, skip the Change All... step. The new app will open that file, but other files of the same type will still use the old default.
Using the Context Menu: Quick "Open With"
Another way to set a default is through the right-click menu, but it's less direct. When you right-click a file, you'll see an Open With submenu. This lets you choose an app for the current file, but it doesn't change the default for future files. To make it permanent, you'd still need to use Get Info.
However, there's a trick: if you hold down the Option key while right-clicking, the Open With submenu changes to Always Open With. Selecting an app from this submenu will set that app as the default for all files of that type, without needing to open Get Info. This is a quick shortcut that many users discover later.
Common Problems and How to Fix Them
Sometimes the association doesn't stick, or the wrong app keeps opening. Here are the most common issues:
- Change All is grayed out: This happens when the file type is not recognized by the system, or when the file is a package (like an app). Try selecting a different file of the same type, or use the "Always Open With" trick with the Option key.
- The app doesn't appear in the list: Some apps don't register themselves as capable of opening certain file types. Use Other... to manually locate the app in the /Applications folder. If it still doesn't work, the app may not support that file type at all.
- The association resets after restart: This can happen if another app (like a utility) is overriding the setting. Try resetting Launch Services (see next section) and then setting the association again.
- File opens in the wrong app after an update: After a system or app update, associations can change. Re-set the default using the steps above.
Resetting Launch Services (The Nuclear Option)
If associations are badly messed up, you can reset the entire Launch Services database. This forces Lion to rebuild it from scratch, and then you can set your defaults again. Here's how:
- Open Terminal (in /Applications/Utilities).
- Type the following command and press Enter:
lsregister -kill -r -domain local -domain system -domain user - Wait for the command to finish (it may take a minute).
- Restart your Mac, or just log out and back in.
After the reset, all file associations will be back to the system defaults. You'll need to re-set any custom associations you had. This is a powerful fix, but it's safe and doesn't delete any files.
Alternatives: Third-Party Tools and Other Methods
While the built-in methods work for most people, some users prefer more control. There are third-party apps that provide a more comprehensive interface for managing file associations. These tools often let you see all file types and their associated apps in one list, and change them in bulk. Some popular ones include RCDefaultApp (free) and SwiftDefaultApps (free). These are not necessary for basic use, but they can be helpful if you have many custom associations.
Another alternative is to use the Open With submenu in the Finder's toolbar. If you select a file and click the gear icon (Action menu), you'll see the same options. This is just a different way to access the same functions.
Safety and Precautions
Changing file associations is generally safe, but there are a few things to keep in mind:
- Don't associate system files with the wrong app: For example, don't set a text editor to open .app files. This could cause problems launching applications.
- Be careful with "Change All": When you click Change All, it affects every file of that type on your system. Make sure you really want that app to be the default.
- Back up before using Terminal: The lsregister command is safe, but if you're not comfortable with Terminal, you might want to skip it and use a GUI tool instead.
Frequently Asked Questions
How do I set a file association for a file type that has no default app?
If you double-click a file and Lion asks you to choose an app, you can select one and check the box "Always Open With" in the dialog. This will set the default for that file type. Alternatively, use Get Info and select the app, then click Change All.
Why does my file always open in the wrong app even after I change it?
This usually happens because the app you chose doesn't actually support the file type, or because another app is overriding the setting. Try a different app, or reset Launch Services as described above. Also, make sure you clicked "Change All" and not just selected the app for the current file.
Can I set different default apps for different file extensions?
Yes, each file type (extension) has its own default app. For example, you can set Preview for .pdf and Adobe Reader for .pdfx (if that extension exists). Just follow the same steps for each file type.
Does the "Always Open With" option work for files on external drives?
Yes, it works for any file, regardless of where it's stored. However, if the external drive is not mounted, the association might not be applied until the drive is connected again.
What if I want to use a different app for a specific file but keep the default for others?
Simply right-click the file, go to "Open With", and choose the app. This opens the file with that app, but doesn't change the default. You can also use "Open With" > "Other..." to select any app.
Is there a way to see all file associations at once?
Not in the built-in Finder. You'd need a third-party tool like RCDefaultApp to see a complete list. The Finder only shows the association for the selected file.