<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Scripting Bridge",
  "identifier" : "/documentation/ScriptingBridge/SBApplication/init(url:)-6xbe5",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Scripting Bridge"
    ],
    "preciseIdentifier" : "c:objc(cs)SBApplication(im)initWithURL:"
  },
  "title" : "init(url:)"
}
-->

# init(url:)

Returns an instance of an `SBApplication` subclass that represents the
target application identified by the given URL.

```
init?(url: URL)
```

## Parameters

`url`

A Universal Resource Locator (URL) specifying an application that is
OSA-compliant.

## Return Value

An initialized `SBApplication` that you can use to communicate
with the target application specified by the process ID. Returns `nil` if an
application could not be found or if the application does not have a
scripting interface.

## Discussion

This approach to initializing `SBApplication` objects should be used only if
you know for certain the URL of the target application. In most cases, it is
better to use [`applicationWithBundleIdentifier:`](/documentation/ScriptingBridge/SBApplication/applicationWithBundleIdentifier:) which
dynamically locates the target application at runtime. Even so, you should
rarely have to initialize an `SBApplication` yourself.

This method currently supports file URLs (`file:`) and remote application
URLs (`eppc:`). It checks whether a file exists at the specified path, but
it does not check whether an application identified via `eppc:` exists.

## See Also

[`applicationWithURL:`](/documentation/ScriptingBridge/SBApplication/applicationWithURL:)

Returns the shared instance representing a target application specified by
the given URL.



---

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)