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

# makeWindowsPerform(_:inOrder:)

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

```
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

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

## See Also

[`tryToPerform(_:with:)`](/documentation/AppKit/NSApplication/tryToPerform(_:with:))

Dispatches an action message to the specified target.

[`sendAction(_:to:from:)`](/documentation/AppKit/NSApplication/sendAction(_:to:from:))

Sends the given action message to the given target.



---

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)