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

# applicationShouldOpenUntitledFile(_:)

Returns a Boolean value that indicates if the app can open an untitled file.

```
@MainActor optional func applicationShouldOpenUntitledFile(_ sender: NSApplication) -> Bool
```

## Parameters

`sender`

The application object associated with the delegate.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the application should open a new untitled file or <doc://com.apple.documentation/documentation/Swift/false> if it should not.

## Discussion

Use this method to decide whether the application should open a new, untitled file. Note that [`applicationOpenUntitledFile(_:)`](/documentation/AppKit/NSApplicationDelegate/applicationOpenUntitledFile(_:)) is invoked if this method returns <doc://com.apple.documentation/documentation/Swift/true>.

---

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)