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

# runModal()

Displays the panel and begins its event loop with the current working (or last-selected) directory as the default starting point.

```
func runModal() -> NSApplication.ModalResponse
```

## Return Value

`NSFileHandlingPanelOKButton` (if the user clicks the OK button) or `NSFileHandlingPanelCancelButton` (if the user clicks the Cancel button).

## Discussion

This method invokes `NSApplication`’s [`runModal(for:)`](/documentation/AppKit/NSApplication/runModal(for:)) method with `self` as the argument.

## See Also

[`runModal(for:)`](/documentation/AppKit/NSApplication/runModal(for:))

Starts a modal event loop for the specified window.



---

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)