<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: 10.0.0 - 10.6.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSOpenPanel/filenames",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSOpenPanel(im)filenames"
  },
  "title" : "filenames"
}
-->

# filenames

Returns an array containing the absolute paths (as NSString objects) of the selected files and directories.

```
- (NSArray *) filenames;
```

## Return Value

The array of filenames.

## Discussion

If multiple selections aren’t allowed, the array contains a single name. The [`filenames`](/documentation/AppKit/NSOpenPanel/filenames) method is preferable over NSSavePanel’s [`filename`](/documentation/AppKit/NSSavePanel/filename) to get the name or names of files and directories that the user has selected.

## See Also

[`var urls: [URL]`](/documentation/AppKit/NSOpenPanel/urls)

An array of URLs, each of which contains the fully specified location of a selected file or directory.



---

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)