<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSDocumentController/currentDirectory",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSDocumentController(py)currentDirectory"
  },
  "title" : "currentDirectory"
}
-->

# currentDirectory

The directory path to use as the starting point in the Open dialog.

```
var currentDirectory: String? { get }
```

## Discussion

The first valid directory from the following list is returned:

- The directory location where the current document was last saved
- The last directory visited in the Open panel
- The user’s home directory

## See Also

[`-  documentForFileName:`](/documentation/AppKit/NSDocumentController/documentForFileName:)

Returns the document object for the file in which the document data is stored.



---

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)