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

# setTitleWithRepresentedFilename(_:)

Sets a given path as the window’s title, formatting it as a file-system path, and records this path as the window’s associated file.

```
func setTitleWithRepresentedFilename(_ filename: String)
```

## Parameters

`filename`

The file path to set as the window’s title.

## Discussion

The windows’ title bar displays the filename, not the file’s path.

## See Also

[`miniwindowTitle`](/documentation/AppKit/NSWindow/miniwindowTitle)

The title displayed in the window’s minimized window.



---

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)