---
title: "LSCanRefAcceptItem(_:_:_:_:_:)"
framework: coreservices
role: symbol
role_heading: Function
path: coreservices/1442183-lscanrefacceptitem
---

# LSCanRefAcceptItem(_:_:_:_:_:)

Tests whether an app can accept (open) an item with a file-system reference.

## Declaration

```swift
func LSCanRefAcceptItem(_ inItemFSRef: UnsafePointer<FSRef>!, _ inTargetRef: UnsafePointer<FSRef>!, _ inRoleMask: LSRolesMask, _ inFlags: LSAcceptanceFlags, _ outAcceptsItem: UnsafeMutablePointer<DarwinBoolean>!) -> OSStatus
```

## Parameters

- `inItemFSRef`: A pointer to a file-system reference designating the source item (the item to test for acceptance by the target application); see the File Manager Reference in the Carbon File Management Documentation for a description of the FSRef data type.
- `inTargetFSRef`: A pointer to a file-system reference designating the target application; see the File Manager Reference in the Carbon File Management Documentation for a description of the FSRef data type.
- `inRolesMask`: A bit mask specifying the target application’s desired role or roles with respect to the source item; see doc://com.apple.documentation/documentation/coreservices/lsrolesmask for a description of this mask. If the role is unimportant, pass kLSRolesAll.
- `inFlags`: Flags specifying behavior to observe during the acceptance test; see doc://com.apple.documentation/documentation/coreservices/lsacceptanceflags for a description of these flags.
- `outAcceptsItem`: A pointer to a Boolean value that, on return, will indicate whether the target application can accept the source item with at least one of the specified roles.

## Return Value

Return Value A result code; see Result Codes.

## Discussion

Discussion Thread-safe since Mac OS version 10.2.

## See Also

### Deprecated Functions

- [LSGetHandlerOptionsForContentType(_:)](coreservices/1445296-lsgethandleroptionsforcontenttyp.md)
- [LSSetHandlerOptionsForContentType(_:_:)](coreservices/1447588-lssethandleroptionsforcontenttyp.md)
- [LSCopyAllHandlersForURLScheme(_:)](coreservices/1443240-lscopyallhandlersforurlscheme.md)
- [LSCopyDefaultHandlerForURLScheme(_:)](coreservices/1441725-lscopydefaulthandlerforurlscheme.md)
- [LSGetApplicationForItem(_:_:_:_:)](coreservices/1446185-lsgetapplicationforitem.md)
- [LSGetApplicationForURL(_:_:_:_:)](coreservices/1445210-lsgetapplicationforurl.md)
- [LSGetApplicationForInfo(_:_:_:_:_:_:)](coreservices/1449928-lsgetapplicationforinfo.md)
- [LSCopyApplicationForMIMEType(_:_:_:)](coreservices/1448586-lscopyapplicationformimetype.md)
- [LSFindApplicationForInfo(_:_:_:_:_:)](coreservices/1449588-lsfindapplicationforinfo.md)
- [LSOpenApplication(_:_:)](coreservices/1447930-lsopenapplication.md)
- [LSOpenItemsWithRole(_:_:_:_:_:_:_:)](coreservices/1449783-lsopenitemswithrole.md)
- [LSOpenURLsWithRole(_:_:_:_:_:_:)](coreservices/1448184-lsopenurlswithrole.md)
- [LSOpenFSRef(_:_:)](coreservices/1445663-lsopenfsref.md)
- [LSOpenFromRefSpec(_:_:)](coreservices/1444466-lsopenfromrefspec.md)
- [LSCopyItemInfoForRef(_:_:_:)](coreservices/1445227-lscopyiteminfoforref.md)
- [LSCopyItemInfoForURL(_:_:_:)](coreservices/1445685-lscopyiteminfoforurl.md)
- [LSCopyDisplayNameForRef(_:_:)](coreservices/1442576-lscopydisplaynameforref.md)
- [LSCopyDisplayNameForURL(_:_:)](coreservices/1446850-lscopydisplaynameforurl.md)
- [LSCopyKindStringForRef(_:_:)](coreservices/1448593-lscopykindstringforref.md)
- [LSCopyKindStringForURL(_:_:)](coreservices/1447481-lscopykindstringforurl.md)
- [LSCopyKindStringForTypeInfo(_:_:_:_:)](coreservices/1446207-lscopykindstringfortypeinfo.md)
- [LSCopyKindStringForMIMEType(_:_:)](coreservices/1442446-lscopykindstringformimetype.md)
- [LSCopyItemAttribute(_:_:_:_:)](coreservices/1445023-lscopyitemattribute.md)
- [LSCopyItemAttributes(_:_:_:_:)](coreservices/1446078-lscopyitemattributes.md)
- [LSGetExtensionInfo(_:_:_:)](coreservices/1446043-lsgetextensioninfo.md)
- [LSSetExtensionHiddenForRef(_:_:)](coreservices/1442766-lssetextensionhiddenforref.md)
- [LSSetExtensionHiddenForURL(_:_:)](coreservices/1443948-lssetextensionhiddenforurl.md)
- [LSRegisterFSRef(_:_:)](coreservices/1444582-lsregisterfsref.md)
