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

# application(_:printFiles:withSettings:showPrintPanels:)

Returns a value that indicates if the app prints the specified files.

```
@MainActor optional func application(_ application: NSApplication, printFiles fileNames: [String], withSettings printSettings: [NSPrintInfo.AttributeKey : Any], showPrintPanels: Bool) -> NSApplication.PrintReply
```

## Parameters

`application`

The application object that is handling the printing.

`fileNames`

An array of <doc://com.apple.documentation/documentation/Foundation/NSString> objects, each of which contains the name of a file to print.

`printSettings`

A dictionary containing `NSPrintInfo`-compatible print job attributes.

`showPrintPanels`

A Boolean that specifies whether the print panel should be displayed for each file printed. Print progress indicators will be presented even if this value is <doc://com.apple.documentation/documentation/Swift/false>.

## Return Value

A constant indicating whether printing was successful. For a list of possible values, see [`NSApplication.PrintReply`](/documentation/AppKit/NSApplication/PrintReply).

## Discussion

Return `NSPrintingReplyLater` if the result of printing cannot be returned immediately, for example, if printing will cause the presentation of a sheet. If your method returns `NSPrintingReplyLater` it must always invoke the `NSApplication` method [`reply(toOpenOrPrint:)`](/documentation/AppKit/NSApplication/reply(toOpenOrPrint:))] when the entire print operation has been completed, successfully or not.

This delegate method replaces `application:printFiles:`, which is now deprecated. If your application delegate only implements the deprecated method, it is still invoked, and `NSApplication` uses private functionality to arrange for the print settings to take effect.

---

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)