<!--
{
  "availability" : [
    "macOS: 10.15.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSWorkspace/open(_:configuration:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSWorkspace(im)openURL:configuration:completionHandler:"
  },
  "title" : "open(_:configuration:completionHandler:)"
}
-->

# open(_:configuration:completionHandler:)

Opens a URL asynchronously using the provided options.

```
func open(_ url: URL, configuration: NSWorkspace.OpenConfiguration, completionHandler: (@Sendable (NSRunningApplication?, (any Error)?) -> Void)? = nil)
```

```
func open(_ url: URL, configuration: NSWorkspace.OpenConfiguration) async throws -> NSRunningApplication
```

## Parameters

`url`

The URL to open.

`configuration`

The options that indicate how you want to open the URL.

`completionHandler`

The completion handler block to call asynchronously with the results. AppKit executes the completion handler on a concurrent queue. The handler block has no return value and takes the following parameters:

- app: On success, this parameter contains a reference to the app that opened the URL. If the app didn’t open the URL successfully, this parameter is `nil`.
- error: On failure, this parameter contains an <doc://com.apple.documentation/documentation/Foundation/NSError> object indicating the reason for the failure. If the method opened the URL successfully, this parameter is `nil`.

## Discussion

You may call this method safely from any thread of your app.

---

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)