<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSDocumentController/noteNewRecentDocumentURL(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSDocumentController(im)noteNewRecentDocumentURL:"
  },
  "title" : "noteNewRecentDocumentURL(_:)"
}
-->

# noteNewRecentDocumentURL(_:)

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

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

## Parameters

`url`

The URL to evaluate.

## Discussion

`NSDocument` automatically calls this method when appropriate for `NSDocument`-based applications. Applications not based on `NSDocument` must also implement the [`application(_:openFile:)`](/documentation/AppKit/NSApplicationDelegate/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).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)