---
title: "SKDocumentCreateWithURL(_:)"
framework: Core Services
role: symbol
role_heading: Function
platforms: [macOS 10.3+]
path: coreservices/1442564-skdocumentcreatewithurl
---

# SKDocumentCreateWithURL(_:)

Creates a document URL object (of type SKDocument) from a CFURL object.

## Declaration

```swift
func SKDocumentCreateWithURL(_ inURL: CFURL!) -> Unmanaged<SKDocument>!
```

## Parameters

- `inURL`: The URL for the document URL object (of type doc://com.apple.documentation/documentation/coreservices/skdocument) you are creating. The scheme of the document URL object gets set to the scheme of the URL used. Only URLs with a scheme of “file” can be used with the doc://com.apple.documentation/documentation/coreservices/1444897-skindexadddocument function, but the URL scheme may be anything you like if you use the doc://com.apple.documentation/documentation/coreservices/1444518-skindexadddocumentwithtext function. For more information on schemes, see link-1670302.

## Return Value

Return Value The new document URL object, or NULL if the document URL object could not be created.

## Discussion

Discussion Use SKDocumentCreateWithURL to create a unique reference to a file or to another, arbitrary URL that your application will use as a document URL object (of type SKDocument). When your application no longer needs the document URL object, dispose of it by calling CFRelease.

## See Also

### Working with Documents and Terms

- [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)
- [SKIndexCopyDocumentRefsForDocumentIDs(_:_:_:_:)](coreservices/1445305-skindexcopydocumentrefsfordocume.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)
