---
title: "SKIndexCopyDocumentRefsForDocumentIDs(_:_:_:_:)"
framework: Core Services
role: symbol
role_heading: Function
platforms: [macOS 10.4+]
path: coreservices/1445305-skindexcopydocumentrefsfordocume
---

# SKIndexCopyDocumentRefsForDocumentIDs(_:_:_:_:)

Gets document URL objects (of type SKDocument) based on document IDs.

## Declaration

```swift
func SKIndexCopyDocumentRefsForDocumentIDs(_ inIndex: SKIndex!, _ inCount: CFIndex, _ inDocumentIDsArray: UnsafeMutablePointer<SKDocumentID>!, _ outDocumentRefsArray: UnsafeMutablePointer<Unmanaged<SKDocument>?>!)
```

## Parameters

- `inIndex`: The index containing the document information.
- `inCount`: The number of document IDs in inDocumentIDsArray.
- `inDocumentIDsArray`: Points to an array of document IDs corresponding to the document URL objects (of type doc://com.apple.documentation/documentation/coreservices/skdocument) you want.
- `outDocumentRefsArray`: On input, a pointer to an array for document URL objects. On output, points to the previously allocated array, which now contains document URL objects corresponding to the document IDs in inDocumentIDsArray. When finished with the document URL objects array, dispose of it by calling doc://com.apple.documentation/documentation/corefoundation/cfrelease on each array element.

## Discussion

Discussion The SKIndexCopyDocumentRefsForDocumentIDs(_:_:_:_:) function lets you get a batch of document URL objects (of type SKDocument) in one step, based on a list of document IDs. If you want to get lightweight URLs in the form of CFURL objects instead, use SKIndexCopyDocumentURLsForDocumentIDs(_:_:_:_:).

## See Also

### Working with Documents and Terms

- [SKDocumentCreateWithURL(_:)](coreservices/1442564-skdocumentcreatewithurl.md)
- [SKDocumentCreate(_:_:_:)](coreservices/1443212-skdocumentcreate.md)
- [SKDocumentCopyURL(_:)](coreservices/1449624-skdocumentcopyurl.md)
- [SKDocumentGetName(_:)](coreservices/1442657-skdocumentgetname.md)
- [SKDocumentGetParent(_:)](coreservices/1444449-skdocumentgetparent.md)
- [SKDocumentGetSchemeName(_:)](coreservices/1448262-skdocumentgetschemename.md)
- [SKDocumentGetTypeID()](coreservices/1448891-skdocumentgettypeid.md)
- [SKIndexCopyDocumentForDocumentID(_:_:)](coreservices/1442760-skindexcopydocumentfordocumentid.md)
- [SKIndexCopyInfoForDocumentIDs(_:_:_:_:_:)](coreservices/1445499-skindexcopyinfofordocumentids.md)
- [SKIndexCopyDocumentURLsForDocumentIDs(_:_:_:_:)](coreservices/1443501-skindexcopydocumenturlsfordocume.md)
- [SKIndexCopyDocumentIDArrayForTermID(_:_:)](coreservices/1448003-skindexcopydocumentidarrayforter.md)
- [SKIndexCopyTermIDArrayForDocumentID(_:_:)](coreservices/1446868-skindexcopytermidarrayfordocumen.md)
- [SKIndexCopyTermStringForTermID(_:_:)](coreservices/1442802-skindexcopytermstringfortermid.md)
- [SKIndexGetTermIDForTermString(_:_:)](coreservices/1448558-skindexgettermidfortermstring.md)
- [SKIndexSetDocumentProperties(_:_:_:)](coreservices/1444576-skindexsetdocumentproperties.md)
- [SKIndexCopyDocumentProperties(_:_:)](coreservices/1449500-skindexcopydocumentproperties.md)
- [SKIndexGetDocumentState(_:_:)](coreservices/1443396-skindexgetdocumentstate.md)
- [SKIndexGetDocumentTermCount(_:_:)](coreservices/1448341-skindexgetdocumenttermcount.md)
- [SKIndexGetDocumentTermFrequency(_:_:_:)](coreservices/1447537-skindexgetdocumenttermfrequency.md)
- [SKIndexGetTermDocumentCount(_:_:)](coreservices/1444015-skindexgettermdocumentcount.md)
- [SKIndexGetDocumentID(_:_:)](coreservices/1444437-skindexgetdocumentid.md)
