How to change Mac file associations?
Answer
Changing file associations on a Mac allows you to control which applications open specific file types by default. This process can be done through the Finder interface for individual files or in bulk, and advanced users can also modify associations via Terminal commands. The most common method involves using the "Get Info" panel to select a new default application, with an option to apply the change to all files of the same type. For users dealing with cluttered "Open With" menus or needing to reset associations, tools like OnyX or Terminal commands can rebuild the Launch Services database to clean up outdated entries.
Key findings from the sources:
- The primary method uses "Get Info" > "Open with" > "Change All..." to permanently change associations [1][3][5]
- Temporary changes can be made via right-click > "Open With" without altering defaults [5][7]
- Bulk changes require creating dummy files or using Terminal commands for multiple file types [6]
- Advanced users can manipulate associations via command line using tools like
dutior resource forks [8]
Changing Mac File Associations
Using Finder for Individual File Types
The standard method for changing file associations on macOS involves the Finder interface, which provides both temporary and permanent solutions. For temporary changes, users can right-click any file, select "Open With," and choose an alternative application from the list without affecting the default setting [5]. This is useful when you need to open a file with a different program just once. For example, you might normally open PDFs with Preview but occasionally need Adobe Acrobat for editing [7].
To permanently change the default application for a file type:
- Right-click the file and select "Get Info" (or select the file and press Command+I)
- In the "Open with" section, choose your preferred application from the dropdown menu
- Click "Change All..." to apply this change to all files of the same type [1][3][5]
- Confirm the change in the dialog box that appears
This method works across all versions of macOS and Mac OS X [5]. The sources specifically demonstrate this process with:
- RTF files being reassigned to Sublime Text [2]
- MP4 files being reassigned to VLC [2]
- JPEG files requiring proper read/write permissions [4]
For files where the desired application doesn't appear in the "Open With" menu:
- Select "Other..." to navigate to the application manually [1]
- Ensure the application is installed in the /Applications folder for it to appear in future menus
- Verify you have proper read/write permissions for the file type in the "Get Info" panel [4]
Advanced Methods for Bulk Changes
For users needing to change associations for multiple file types simultaneously, macOS offers several advanced approaches. The most comprehensive method involves creating dummy files and using Terminal commands, particularly useful when transitioning media files to a custom player like VLC [6]. This process requires:
- Creating a text file at
~/types.txtwith one file extension per line (e.g.,.mp4,.mkv,.mp3) - Generating dummy files for each type using Terminal:
while read -r ext; do touch "/tmp/dummy$ext"; done < ~/types.txt
- Selecting all dummy files in Finder, then using "Get Info" to change their default application in bulk [6]
For command-line enthusiasts, the duti tool provides granular control over file associations:
- Install via Homebrew:
brew install duti - Set default applications using commands like:
duti -s com.apple.TextEdit public.plain-text all
- This changes all plain text files to open with TextEdit by default [8]
When the "Open With" menu becomes cluttered with outdated or unwanted applications:
- Rebuild the Launch Services database using OnyX utility (free maintenance tool)
- Alternatively use this Terminal command:
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user
This resets all file associations to system defaults [1][3]
For individual file associations via command line:
- Use the
opencommand with the-aflag to specify an application:
open -a "VLC" example.mp4
- Create temporary associations using extended attributes:
xattr -w com.apple.FinderInfo "APPL????" example.mp4
(Where "APPL" represents the application's creator code) [8]
Sources & References
eshop.macsales.com
macrumors.com
world.hey.com
apple.stackexchange.com
Discussions
Sign in to join the discussion and share your thoughts
Sign InFAQ-specific discussions coming soon...