Function

LSCopyDefaultApplicationURLForContentType

Returns the application used to open a content type (UTI).

Declaration

CFURLRef LSCopyDefaultApplicationURLForContentType(CFStringRef inContentType, LSRolesMask inRoleMask, CFErrorRef  _Nullable *outError);

Parameters

inContentType

The Uniform Type Identifier (UTI) of the item for which the application is requested.

inRoleMask

Whether to return the editor or viewer for inContentType. If you don't care which, use kLSRolesAll.

outError

On failure, set to a CFErrorRef describing the problem. If you are not interested in this information, pass NULL. The caller is responsible for releasing this object.

Return Value

If an acceptable application is found, its URL is returned. If no application could be found, NULL is returned and outError (if not NULL) is populated with kLSApplicationNotFoundErr. The caller is responsible for releasing this URL.

Discussion

Consults the binding tables to return the application that would be used to open a file of type inContentType if it were double-clicked in the Finder. This application will be the user-specified override if appropriate or the default otherwise.

See Also

Locating an Application

LSCopyDefaultApplicationURLForURL

Returns the application used to open an item.

LSGetApplicationForItem

Locates the preferred application for opening an item designated by file-system reference.

Deprecated
LSGetApplicationForURL

Locates the preferred application for opening an item designated by URL.

Deprecated
LSGetApplicationForInfo

Locates the preferred application for opening items with a specified file type, creator signature, filename extension, or any combination of these characteristics.

Deprecated
LSCopyApplicationForMIMEType

Locates the preferred application for opening items with a specified MIME type.

Deprecated
LSCopyApplicationURLsForURL

Locates all known applications suitable for opening an item designated by the specified URL.

LSCanURLAcceptURL

Tests whether an application can accept (open) an item designated by URL.

LSCanRefAcceptItem

Tests whether an application can accept (open) an item designated by file-system reference.

Deprecated
LSCopyApplicationURLsForBundleIdentifier

Locates all URLs for applications that correspond to the specified bundle identifier.

LSFindApplicationForInfo

Locates an application with a specified creator signature, bundle ID, filename, or any combination of these characteristics.

Deprecated