---
title: "applicationShouldOpenUntitledFile(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsapplicationdelegate/applicationshouldopenuntitledfile(_:)"
---

# applicationShouldOpenUntitledFile(_:)

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

## Declaration

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

## Parameters

- `sender`: The application object associated with the delegate.

## Return Value

Return Value true if the application should open a new untitled file or false if it should not.

## Discussion

Discussion Use this method to decide whether the application should open a new, untitled file. Note that applicationOpenUntitledFile(_:) is invoked if this method returns true.

## See Also

### Opening Files

- [application(_:open:)](appkit/nsapplicationdelegate/application(_:open:).md)
- [application(_:openFile:)](appkit/nsapplicationdelegate/application(_:openfile:).md)
- [application(_:openFileWithoutUI:)](appkit/nsapplicationdelegate/application(_:openfilewithoutui:).md)
- [application(_:openTempFile:)](appkit/nsapplicationdelegate/application(_:opentempfile:).md)
- [application(_:openFiles:)](appkit/nsapplicationdelegate/application(_:openfiles:).md)
- [applicationOpenUntitledFile(_:)](appkit/nsapplicationdelegate/applicationopenuntitledfile(_:).md)
