---
title: "noteNewRecentDocumentURL(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsdocumentcontroller/notenewrecentdocumenturl(_:)"
---

# noteNewRecentDocumentURL(_:)

Adds or replaces an Open Recent menu item corresponding to the data located by the URL.

## Declaration

```swift
func noteNewRecentDocumentURL(_ url: URL)
```

## Parameters

- `url`: The URL to evaluate.

## Discussion

Discussion NSDocument automatically calls this method when appropriate for NSDocument-based applications. Applications not based on NSDocument must also implement the application(_:openFile:) method in the application delegate to handle requests from the Open Recent menu command. You can override this method in an NSDocument-based application to prevent certain kinds of documents from getting into the list (but you have to identify them by URL).

## See Also

### Managing the Open Recent Menu

- [maximumRecentDocumentCount](appkit/nsdocumentcontroller/maximumrecentdocumentcount.md)
- [clearRecentDocuments(_:)](appkit/nsdocumentcontroller/clearrecentdocuments(_:).md)
- [noteNewRecentDocument(_:)](appkit/nsdocumentcontroller/notenewrecentdocument(_:).md)
- [recentDocumentURLs](appkit/nsdocumentcontroller/recentdocumenturls.md)
