- Understanding the System File Structure
- Managing Font Resources
- Managing Hidden Items
- Using Aliases and Links
- Understanding File System Metadata
- Managing Launch Services
- Using Spotlight and Quick Look
- Using File Archives and Disk Images
- Managing Time Machine
- What You've Learned
- References
- Review Quiz
Managing Launch Services
Aside from a file’s name, the most fundamentally important piece of metadata about a file is its type. Identifying a file’s type allows Lion to almost always choose the correct application to open when you double-click on a file. Launch Services is the technology responsible for helping Lion make the connection between a file’s type and the appropriate application. When you double-click on a file from the Finder, it asks Launch Services to open the file with the appropriate application. Launch Services identifies the file based on its type and then references an application registration database to determine which application should open the file.
File Type Identification
Apple pioneered file type identification when it first introduced the Macintosh operating system. Apple designed the file identification system to use four-character file type and creator signature file attributes, which were normally hidden from the user. This was a brilliant design that separated the file’s type and default application binding from the file’s name.
Unfortunately, the popularity of other operating systems forced the awkward practice of adding a file type identifier to the end of a file’s name, thus complicating the practice of naming files by requiring the user to identify and maintain the appropriate filename extension such as .mp3 for compressed audio files, .jpg for compressed picture files, or .doc for Microsoft Word files. Using filename extensions has become standard practice, so modern operating systems have been designed to work around this poor design choice by simply hiding the filename extension from the user. For the sake of compatibility, Apple adopted this later method of file type identification as the default for all versions of Mac OS X.
Since the Finder hides many file type extensions by default, you can toggle file type extension visibility from the Finder’s preferences by choosing Finder > Preferences from the menu bar. Then click the Advanced button and select or deselect the checkbox next to “Show all file extensions.”
Application Registration
When a user attempts to open a file of a certain type, Launch Services reads from a database of applications and the types of files each can open to determine a match. Successful file and application match information is cached, so future attempts to open an application are as quick as possible. However, after every startup or login, a background process automatically scans for new applications and updates this database. Further, both the Finder and Installer keep track of new applications as they arrive on your system and add their supported file types to the database.
The application registration system is pretty good at finding matches, so odds are if the system gives you an error message, then you probably don’t have the correct application for the file. In Lion, Launch Services maps many common file types to the built-in Preview and TextEdit applications if the primary application is missing. For example, Numbers or Excel documents open in Preview and Pages and Word documents open in TextEdit.
If Preview, or any other application, cannot properly open a specific file type, you can change the Launch Service settings to force those files to open in a more appropriate application, as outlined below. Other times, though, Launch Services may not have any idea which application to use for the file type. If you attempt to open a file type that is not stored in the Launch Services database, the computer will prompt you to find an application that supports the file. Alternately, you can use a new feature in Lion that will search the Mac App Store for a compatible application.
Change Launch Service Settings
From the Finder’s Get Info window, you can override Launch Services’ default application settings for any specific file type. These custom settings are saved per user, so one user’s application preferences will not override another user’s. They are saved to the com.apple.LaunchServices.plist preference file in each user’s ~/Library/Preferences folder.
To change a user’s Launch Services settings in the Finder:
- In the Finder, select the file or multiple files you wish to change the Launch Services settings for, and then open the Get Info or Inspector window.
To open the Get Info window, do one of the following (performing the same tasks while holding the Option key will open an Inspector window):
- Choose File > Get Info from the menu bar.
- Use the Command-I keyboard shortcut.
- Choose Get Info from the Action pop-up menu (the small gear icon) in a Finder window toolbar.
- Choose Get Info from the Finder’s shortcut menu by right-clicking or Control-clicking on an item.
- Once you have opened a Get Info window, click the “Open with” disclosure triangle to reveal the default application selected by Launch Services.
To change just the selected files’ default application, simply select another application from the pop-up menu.
To change the default application for all files of this type, click the Change All button.
- All Launch Services changes take place immediately.