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

# reply(toOpenOrPrint:)

Handles errors that might occur when the user attempts to open or print files.

```
func reply(toOpenOrPrint reply: NSApplication.DelegateReply)
```

## Parameters

`reply`

The error that occurred. For a list of possible values, see [`NSApplication.DelegateReply`](/documentation/AppKit/NSApplication/DelegateReply).

## Discussion

Delegates should invoke this method if an error is encountered in the [`application(_:openFiles:)`](/documentation/AppKit/NSApplicationDelegate/application(_:openFiles:)) or [`application(_:printFiles:withSettings:showPrintPanels:)`](/documentation/AppKit/NSApplicationDelegate/application(_:printFiles:withSettings:showPrintPanels:)) delegate methods.

---

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)