by Tom Nelson
Launch Services is a core service of the Mac OS that enables an actively running application to open other apps, documents, or URLs (Uniform Resource Locators). Launch Services is also used to prioritize which app is used to open a document or URL.
Launch Services replaced a number of earlier system managers the Mac used to use, such as the Desktop Manager, Internet Config, and File Manager, replacing them with the single Launch Services system, and the database Launch Services maintains to keep track of all things related to how documents and apps relate to each other.
Launch Services allows an app or document to:
- Open (launch or activate) another app.
- Open a document or URL.
- Identify the preferred app to use to open a document or URL.
- Register the type of documents or URLs an app is capable of working with.
- Keep track of information needed for displaying a file or URL, including its icon, name, and kind (examples: JPEG, PDF, Folder, Volume).
Launch Services keeps track of which apps can work with a selected document. Screen shot © Coyote Moon, Inc.
In past versions of the Mac OS, this type of information was maintained by the Finder, as well as by some specific system managers. By consolidating this information to the Launch Services, it allows for greater reliability, easier (actually, automatic) registration of file and document associations, and less need to repair file association information. If you remember having to rebuild the Desktop frequently on older Macs, then you know the file associations tended to get out of whack often.
Launch Services maintains a database aptly known as the Launch Services Database, which is used to record all the needed information about apps, documents, and URLs to determine which items an app is capable of working with.
Application Registration
Launch Services automatically registers an app with the database the first time the app becomes known to the system. This can occur when:
- The Finder reports an app has been added to the Applications folder.
- An app installer is run.
- When a document is opened that has no preferred app, the user is asked to select an app to use, and that app is registered with Launch Services.
- When the built-in Launch Services tool is run whenever you boot your Mac or login as a user. This tool scans the Applications folder looking for any new apps that have been placed there.
Dragging an app to the Applications folder is one of the ways an app is registered with Launch Services. Screen shot © Coyote Moon, Inc.
Opening Documents
When you open a document or URL, Launch Services is used to determine which app to use to open the item. Launch Services uses the following specific order to check for which app to use:
User-Specified Binding: If the user has set a specific binding by manually setting a file association, then use that app to open the document or URL. Do not check further. Note: You can manually set file associations using one of the tips in: Quick Tip: Managing macOS File Associations or macOS 101: Six “Forgotten” Tips for New (and Old) Mac Users.
If the document has a file name extension, Launch Services will find all apps that list the extension as compatible.
If the document has a four-character file type, Launch Services finds all apps that accept the file type.
If more than one app is found, the following is used to determine a preference:
If the document has a four-character creator type that matches an app:
Give preference to apps on the boot volume.
Give preferences to apps residing on local volumes vs. ones on remote volumes.
If two or more files and an app still meet the criteria, give preference to the newest version.