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

# application(_:openFileWithoutUI:)

Returns a Boolean value that indicates if the app opens the specified file without showing its user interface.

```
@MainActor optional func application(_ sender: Any, openFileWithoutUI filename: String) -> Bool
```

## Parameters

`sender`

The object that sent the command.

`filename`

The name of the file to open.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the file was successfully opened or <doc://com.apple.documentation/documentation/Swift/false> if it was not.

## Discussion

Sent directly by `sender` to the delegate to request that the file `filename` be opened as a linked file. The method should open the file without bringing up its application’s user interface—that is, work with the file is under programmatic control of `sender`, rather than under keyboard control of the user.

## See Also

[`application(_:printFile:)`](/documentation/AppKit/NSApplicationDelegate/application(_:printFile:))

Returns a Boolean value that indicates if the app prints the specified file in its entirety.



---

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)