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

# setDirectory:

Sets the current pathname in the panel’s browser.

```
- (void) setDirectory:(NSString *) path;
```

## Parameters

`path`

String to set as the panel’s current pathname.

## Discussion

The `path` argument must be an absolute pathname.

## See Also

[`var directoryURL: URL?`](/documentation/AppKit/NSSavePanel/directoryURL)

The current directory shown in the panel.



---

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)