LSCopyApplicationForMIMEType(_:_:_:)
Locates the preferred app for opening items with a specified MIME type.
Declaration
func LSCopyApplicationForMIMEType(_ inMIMEType: CFString!, _ inRoleMask: LSRolesMask, _ outAppURL: UnsafeMutablePointer<Unmanaged<CFURL>?>!) -> OSStatusParameters
- inMIMEType:
A Core Foundation string object specifying the MIME type to consider; see the CFString Reference in the Core Foundation Reference Documentation for a description of the
CFStringRefdata type. Comparison of MIME types is case-insensitive. - inRolesMask:
A bit mask specifying the application’s desired role or roles with respect to items with the specified MIME type; see Lsrolesmask for a description of this mask. If the role is unimportant, pass
kLSRolesAll. - outAppURL:
A pointer to a Core Foundation URL reference that, on return, will identify the preferred application for items with the specified MIME type; see the CFURL Reference in the Core Foundation Reference Documentation for a description of the
CFURLRefdata type. You are responsible for releasing the URL reference object.
Return Value
A result code; see Result Codes. If no application suitable for opening items with the specified MIME type is found in the Launch Services database, the function will return the result code kLSApplicationNotFoundErr.
Discussion
Thread-safe since Mac OS version 10.2.
See Also
Deprecated Functions
LSGetHandlerOptionsForContentType(_:)LSSetHandlerOptionsForContentType(_:_:)LSCopyAllHandlersForURLScheme(_:)LSCopyDefaultHandlerForURLScheme(_:)LSGetApplicationForItem(_:_:_:_:)LSGetApplicationForURL(_:_:_:_:)LSGetApplicationForInfo(_:_:_:_:_:_:)LSCanRefAcceptItem(_:_:_:_:_:)LSFindApplicationForInfo(_:_:_:_:_:)LSOpenApplication(_:_:)LSOpenItemsWithRole(_:_:_:_:_:_:_:)LSOpenURLsWithRole(_:_:_:_:_:_:)LSOpenFSRef(_:_:)LSOpenFromRefSpec(_:_:)LSCopyItemInfoForRef(_:_:_:)LSCopyItemInfoForURL(_:_:_:)LSCopyDisplayNameForRef(_:_:)LSCopyDisplayNameForURL(_:_:)LSCopyKindStringForRef(_:_:)LSCopyKindStringForURL(_:_:)LSCopyKindStringForTypeInfo(_:_:_:_:)LSCopyKindStringForMIMEType(_:_:)LSCopyItemAttribute(_:_:_:_:)LSCopyItemAttributes(_:_:_:_:)LSGetExtensionInfo(_:_:_:)LSSetExtensionHiddenForRef(_:_:)LSSetExtensionHiddenForURL(_:_:)LSRegisterFSRef(_:_:)