<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Scripting Bridge",
  "identifier" : "/documentation/ScriptingBridge/SBApplicationDelegate",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Scripting Bridge"
    ],
    "preciseIdentifier" : "c:objc(pl)SBApplicationDelegate"
  },
  "title" : "SBApplicationDelegate"
}
-->

# SBApplicationDelegate

This informal protocol defines a delegation method for handling Apple event
errors that are sent from a target application to an
<doc://com.apple.documentation/documentation/ScriptingBridge/SBApplication>
object.

```
protocol SBApplicationDelegate
```

## Overview

You must set a delegate for the [`SBApplication`](/documentation/ScriptingBridge/SBApplication) object using the
[`delegate`](/documentation/ScriptingBridge/SBApplication/delegate) method. If you do not set a delegate and have the
delegate handle the error in some way, [`SBApplication`](/documentation/ScriptingBridge/SBApplication) raises an
exception.

## Topics

### Handling Errors

[`-  eventDidFail:withError:`](/documentation/ScriptingBridge/SBApplicationDelegate/eventDidFail(_:withError:))

Sent by an `SBApplication` object when a target application returns an error
Apple event.



---

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)