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

# application(_:openFiles:)

Tells the delegate to open the specified files.

```
@MainActor optional func application(_ sender: NSApplication, openFiles filenames: [String])
```

## Parameters

`sender`

The application object associated with the delegate.

`filenames`

An array of `NSString` objects containing the names of the files to open..

## Discussion

Identical to [`application(_:openFile:)`](/documentation/AppKit/NSApplicationDelegate/application(_:openFile:)) except that the receiver opens multiple files corresponding to the file names in the `filenames` array. Delegates should invoke the [`reply(toOpenOrPrint:)`](/documentation/AppKit/NSApplication/reply(toOpenOrPrint:)) method upon success or failure, or when the user cancels the operation.

---

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)