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

# changeWindowsItem(_:title:filename:)

Changes the item for a given window in the Window menu to a given string.

```
func changeWindowsItem(_ win: NSWindow, title string: String, filename isFilename: Bool)
```

## Parameters

`win`

The window whose title you want to change in the Window menu. If `aWindow` is not in the Window menu, this method adds it.

`string`

The string to display for the window’s menu item. How the string is interpreted is dependent on the value in the `isFilename` parameter.

`isFilename`

If <doc://com.apple.documentation/documentation/Swift/false>, `aString` appears literally in the menu; otherwise, `aString` is assumed to be a converted pathname with the name of the file preceding the path (the way the `NSWindow` method [`setTitleWithRepresentedFilename(_:)`](/documentation/AppKit/NSWindow/setTitleWithRepresentedFilename(_:)) shows a title)

## See Also

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

The string that appears in the title bar of the window or the path to the represented file.



---

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)