Mac OS X Reference Library Apple Developer
Search

SBApplicationDelegate Protocol Reference

Framework
/System/Library/Frameworks/ScriptingBridge.framework
Availability
Available in Mac OS X v10.6 and later.
Declared in
SBApplication.h

Overview

This informal protocol defines a delegation method for handling Apple event errors that are sent from an target application to an SBApplication object.

You must set a delegate for the SBApplication object using the setDelegate: method. If you do not set a delegate and have the delegate handle the error in some way, SBApplication raises an exception.

Tasks

Handling Errors

Instance Methods

eventDidFail:withError:

Sent by an SBApplication object when a target application returns an error Apple event. (required)

- (void)eventDidFail:(const AppleEvent *)event withError:(NSError *)error

Parameters
event

A pointer to the Apple event sent to the target application causing the error.

error

An object containing information about the error Apple event. Specific information may be included in the useInfo dictionary of the error object. See “User Info Dictionary Keys” for a list of possible keys for this dictionary.

Availability
  • Available in Mac OS X v10.5 and later.
  • Available as part of an informal protocol prior to Mac OS X v10.6.
Declared In
SBApplication.h

Constants

User Info Dictionary Keys

The following describes the possible keys for the userInfo dictionary of the NSError object passed to the delegate. Note that for some errors, the userInfo dictionary may not have any of these keys.

Constants
@"ErrorBriefMessage"

A short human-readble description of the error, as an NSString object.

@"ErrorExpectedType"

The type of data the target application expected, as an NSAppleEventDescriptor object.

@"ErrorOffendingObject"

The object that caused the error.

@"ErrorString"

A full human-readable description of the error, as an NSString object.

@"ErrorNumber"

The Apple event error number, as an NSNumber object.

Declared In
ScriptingBridge/SBApplication.h



Last updated: 2007-05-29

Did this document help you? Yes It's good, but... Not helpful...