Function

LSCopyApplicationURLsForBundleIdentifier(_:_:)

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

Declaration

func LSCopyApplicationURLsForBundleIdentifier(_ inBundleIdentifier: CFString, _ outError: UnsafeMutablePointer<Unmanaged<CFError>?>?) -> Unmanaged<CFArray>?

Parameters

inBundleIdentifier

The bundle identifier of interest, such as "com.apple.finder". Must not be NULL.

outError

On failure, set to a CFError describing the problem. If you aren't interested in this information, pass NULL. The caller is responsible for releasing this object.

Return Value

The URLs for any applications with the specified bundle identifier returned in a CFArray. If no application is found, NULL is returned and outError (if not NULL) is populated with kLSApplicationNotFoundErr.

In macOS 10.15 and later, the returned array is sorted with the first element containing the best available application with the specified bundle identifier. Prior to macOS 10.15, the order of elements in the array was undefined.

The caller is responsible for releasing this array.

See Also

Locating an Application

func LSGetApplicationForItem(UnsafePointer<FSRef>!, LSRolesMask, UnsafeMutablePointer<FSRef>!, UnsafeMutablePointer<Unmanaged<CFURL>?>!) -> OSStatus

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

Deprecated
func LSGetApplicationForInfo(OSType, OSType, CFString!, LSRolesMask, UnsafeMutablePointer<FSRef>!, UnsafeMutablePointer<Unmanaged<CFURL>?>!) -> OSStatus

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

Deprecated
func LSCopyApplicationForMIMEType(CFString!, LSRolesMask, UnsafeMutablePointer<Unmanaged<CFURL>?>!) -> OSStatus

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

Deprecated
func LSCopyApplicationURLsForURL(CFURL, LSRolesMask) -> Unmanaged<CFArray>?

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

func LSCanRefAcceptItem(UnsafePointer<FSRef>!, UnsafePointer<FSRef>!, LSRolesMask, LSAcceptanceFlags, UnsafeMutablePointer<DarwinBoolean>!) -> OSStatus

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

Deprecated
func LSFindApplicationForInfo(OSType, CFString!, CFString!, UnsafeMutablePointer<FSRef>!, UnsafeMutablePointer<Unmanaged<CFURL>?>!) -> OSStatus

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

Deprecated