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

# urlsForApplications(toOpen:)

Returns an array of URLs to all available applications that can open the URL.

```
func urlsForApplications(toOpen url: URL) -> [URL]
```

## Parameters

`url`

The URL of the file to open.

## Return Value

An array of URLs to available apps that can open the specified `url`. Returns an empty array if no app can open the URL, or if the file URL doesn’t exist.

## Discussion

The system sorts the resulting array according to each app’s suitability to open the URL. The returned array lists the best match first.

---

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)