---
title: "changeWindowsItem(_:title:filename:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsapplication/changewindowsitem(_:title:filename:)"
---

# changeWindowsItem(_:title:filename:)

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

## Declaration

```swift
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 doc://com.apple.appkit/documentation/AppKit/NSWindow/setTitleWithRepresentedFilename(_:) shows a title)

## See Also

### Related Documentation

- [title](appkit/nswindow/title.md)

### Managing the Window Menu

- [windowsMenu](appkit/nsapplication/windowsmenu.md)
- [addWindowsItem(_:title:filename:)](appkit/nsapplication/addwindowsitem(_:title:filename:).md)
- [removeWindowsItem(_:)](appkit/nsapplication/removewindowsitem(_:).md)
- [updateWindowsItem(_:)](appkit/nsapplication/updatewindowsitem(_:).md)
