LSOpenURLsWithRole(_:_:_:_:_:_:)
Opens one or more URLs with the specified roles.
Declaration
func LSOpenURLsWithRole(_ inURLs: CFArray!, _ inRole: LSRolesMask, _ inAEParam: UnsafePointer<AEKeyDesc>!, _ inAppParams: UnsafePointer<LSApplicationParameters>!, _ outPSNs: UnsafeMutablePointer<ProcessSerialNumber>!, _ inMaxPSNCount: CFIndex) -> OSStatusParameters
- inURLs:
An array of values of type
CFURLRef. - inRole:
A value of type
LSRolesMaskspecifying one or more roles. If the role doesn’t matter, usekLSRolesAll. For possible values, see Lsrolesmask. This parameter is ignored if theinAppParamsparameter is notNULL. - inAEParam:
A value of type
AEKeyDescthat is to be attached to the Apple Event(s) generated by Launch Services with the specifiedAEKeyword. This parameter can beNULL. - inAppParams:
An Lsapplicationparameters structure specifying the application to launch and its launch parameters, in which case the
inRoleparameter is ignored. This parameter can beNULL, in which case an application is selected that can handle each input URL in at least one of the roles specified by theinRoleparameter. - outPSNs:
On input, a pointer to a caller-allocated buffer or
NULLif you don’t want to receive process serial number (PSN) information. If notNULLon input, on return, the buffer contains at each index the PSN that was used to open the URL at the same index of the input URL array (inURLs). - inMaxPSNCount:
The maximum number of PSNs that the buffer pointed to by
outPSNscan hold.
Return Value
A result code; see Result Codes.
Discussion
This function opens the URLs specified by inURLs with the roles specified by inRole.
Each launched application receives one or more 'GURL' Apple Events specifying the URLs to be opened. You can also pass file URLs, which are interpreted as file system items and opened in the manner of LSOpenItemsWithRole(_:_:_:_:_:_:_:) (that is, a handler is selected based on the item’s filesystem metadata).If inURLs contains any application URLs, this function launches them only if the kLSRolesShell bit is set in the inRoles parameter, in which case the application is its own shell.If not NULL, the outPSNs buffer is filled with the process serial numbers that were used to open each URL at the same index of the input URL array specified by the inURLs parameter. The PSN capacity of the output buffer is specified by inMaxPSNCount.
Version-Notes
Thread-safe since OS X v10.4.
See Also
Deprecated Functions
LSGetHandlerOptionsForContentType(_:)LSSetHandlerOptionsForContentType(_:_:)LSCopyAllHandlersForURLScheme(_:)LSCopyDefaultHandlerForURLScheme(_:)LSGetApplicationForItem(_:_:_:_:)LSGetApplicationForURL(_:_:_:_:)LSGetApplicationForInfo(_:_:_:_:_:_:)LSCopyApplicationForMIMEType(_:_:_:)LSCanRefAcceptItem(_:_:_:_:_:)LSFindApplicationForInfo(_:_:_:_:_:)LSOpenApplication(_:_:)LSOpenItemsWithRole(_:_:_:_:_:_:_:)LSOpenFSRef(_:_:)LSOpenFromRefSpec(_:_:)LSCopyItemInfoForRef(_:_:_:)LSCopyItemInfoForURL(_:_:_:)LSCopyDisplayNameForRef(_:_:)LSCopyDisplayNameForURL(_:_:)LSCopyKindStringForRef(_:_:)LSCopyKindStringForURL(_:_:)LSCopyKindStringForTypeInfo(_:_:_:_:)LSCopyKindStringForMIMEType(_:_:)LSCopyItemAttribute(_:_:_:_:)LSCopyItemAttributes(_:_:_:_:)LSGetExtensionInfo(_:_:_:)LSSetExtensionHiddenForRef(_:_:)LSSetExtensionHiddenForURL(_:_:)LSRegisterFSRef(_:_:)