---
title: "makeWindowsPerform(_:inOrder:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsapplication/makewindowsperform(_:inorder:)"
---

# makeWindowsPerform(_:inOrder:)

Sends the specified message to each of the app’s window objects until one returns a non-nil value.

## Declaration

```swift
func makeWindowsPerform(_ selector: Selector, inOrder: Bool) -> NSWindow?
```

## Parameters

- `selector`: The selector to perform on each window. This method must not take any arguments and must return a value whose type that can be compared to nil.
- `inOrder`: If doc://com.apple.documentation/documentation/Swift/true, the aSelector message is sent to each of the window server’s onscreen windows, going in z-order, until one returns a non-nil value. A minimized window is not considered to be onscreen for this check. If doc://com.apple.documentation/documentation/Swift/false, the message is sent to all windows in NSApp’s window list, regardless of whether or not they are onscreen. This order is unspecified.

## Return Value

Return Value The window that returned a non-nil value or nil if all windows returned nil from aSelector.

## See Also

### Related Documentation

- [tryToPerform(_:with:)](appkit/nsapplication/trytoperform(_:with:).md)
- [sendAction(_:to:from:)](appkit/nsapplication/sendaction(_:to:from:).md)

### Managing App Windows

- [keyWindow](appkit/nsapplication/keywindow.md)
- [mainWindow](appkit/nsapplication/mainwindow.md)
- [window(withWindowNumber:)](appkit/nsapplication/window(withwindownumber:).md)
- [windows](appkit/nsapplication/windows.md)
- [enumerateWindows(options:using:)](appkit/nsapplication/enumeratewindows(options:using:).md)
- [NSApplication.WindowListOptions](appkit/nsapplication/windowlistoptions.md)
