<!--
{
  "availability" : [
    "macOS: 10.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSWindow/representedURL",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSWindow(py)representedURL"
  },
  "title" : "representedURL"
}
-->

# representedURL

The URL of the file the window represents.

```
var representedURL: URL? { get set }
```

## Discussion

When the URL specifies a path, the window shows an icon in its title bar, as described in the following table:

|File path                   |Document icon               |
|----------------------------|----------------------------|
|Empty                       |None                        |
|Specifies a nonexistent file|Generic                     |
|Specifies an existent file  |Specific for the file’s type|

You can customize the file icon in the title bar with the following code:

```objc
[[<window> standardWindowButton:NSWindowDocumentIconButton] setImage:<image>]
```

When the URL identifies an existing file, the window’s title offers a pop-up menu showing the path components of the URL. (The user displays this menu by Command-clicking the title.) The behavior and contents of this menu can be controlled with [`window(_:shouldPopUpDocumentPathMenu:)`](/documentation/AppKit/NSWindowDelegate/window(_:shouldPopUpDocumentPathMenu:)).

## See Also

[`-  window:shouldDragDocumentWithEvent:from:withPasteboard:`](/documentation/AppKit/NSWindowDelegate/window(_:shouldDragDocumentWith:from:with:))

Asks the delegate whether a user can drag the document icon from the window’s title bar.



---

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)