---
title: "application(_:openFiles:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsapplicationdelegate/application(_:openfiles:)"
---

# application(_:openFiles:)

Tells the delegate to open the specified files.

## Declaration

```swift
@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

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

## 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)
- [applicationShouldOpenUntitledFile(_:)](appkit/nsapplicationdelegate/applicationshouldopenuntitledfile(_:).md)
- [applicationOpenUntitledFile(_:)](appkit/nsapplicationdelegate/applicationopenuntitledfile(_:).md)
