---
title: "urlForApplication(toOpen:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsworkspace/urlforapplication(toopen:)-7qkzf"
---

# urlForApplication(toOpen:)

Returns the URL to the default app to open the specified URL.

## Declaration

```swift
func urlForApplication(toOpen url: URL) -> URL?
```

## Parameters

- `url`: The URL of the file to open.

## Return Value

Return Value The URL of the default app that would open the specified url. Returns nil if no app can open the URL, or if the file URL does not exist.

## Discussion

Discussion This method is the programmatic equivalent of double-clicking a document in the Finder. You can safely call this method from any thread of your app.

## See Also

### Requesting Information

- [urlForApplication(toOpen:)](appkit/nsworkspace/urlforapplication(toopen:)-95cvp.md)
- [urlForApplication(withBundleIdentifier:)](appkit/nsworkspace/urlforapplication(withbundleidentifier:).md)
- [urlsForApplications(toOpen:)](appkit/nsworkspace/urlsforapplications(toopen:)-ualk.md)
- [urlsForApplications(toOpen:)](appkit/nsworkspace/urlsforapplications(toopen:)-60rkm.md)
- [urlsForApplications(withBundleIdentifier:)](appkit/nsworkspace/urlsforapplications(withbundleidentifier:).md)
- [getFileSystemInfo(forPath:isRemovable:isWritable:isUnmountable:description:type:)](appkit/nsworkspace/getfilesysteminfo(forpath:isremovable:iswritable:isunmountable:description:type:).md)
- [isFilePackage(atPath:)](appkit/nsworkspace/isfilepackage(atpath:).md)
- [frontmostApplication](appkit/nsworkspace/frontmostapplication.md)
- [runningApplications](appkit/nsworkspace/runningapplications.md)
- [menuBarOwningApplication](appkit/nsworkspace/menubarowningapplication.md)
- [getInfoForFile(_:application:type:)](appkit/nsworkspace/getinfoforfile(_:application:type:).md)
