Mac Developer Library

Developer

Foundation Framework Reference NSAppleEventDescriptor Class Reference

Options
Deployment Target:

On This Page
Language:

NSAppleEventDescriptor

An instance of NSAppleEventDescriptor represents a descriptor—the basic building block for Apple events. This class is a wrapper for the underlying Apple event descriptor data type, AEDesc. Scriptable Cocoa applications frequently work with instances of NSAppleEventDescriptor, but should rarely need to work directly with the AEDesc data structure. More...

Inheritance


Import Statement


import Foundation @import Foundation;

Availability


Available in OS X v10.0 and later.
  • Creates a descriptor that represents an Apple event, initialized according to the specified information.

    Declaration

    Swift

    class func appleEventWithEventClass(_ eventClass: AEEventClass, eventID eventID: AEEventID, targetDescriptor addressDescriptor: NSAppleEventDescriptor?, returnID returnID: AEReturnID, transactionID transactionID: AETransactionID) -> NSAppleEventDescriptor?

    Objective-C

    + (NSAppleEventDescriptor *)appleEventWithEventClass:(AEEventClass)eventClass eventID:(AEEventID)eventID targetDescriptor:(NSAppleEventDescriptor *)addressDescriptor returnID:(AEReturnID)returnID transactionID:(AETransactionID)transactionID

    Parameters

    eventClass

    The event class to be set in the returned descriptor.

    eventID

    The event ID to be set in the returned descriptor.

    addressDescriptor

    A pointer to a descriptor that identifies the target application for the Apple event. Passing nil results in an Apple event descriptor that has no keyAddressAttr attribute (it is valid for an Apple event to have no target address attribute).

    returnID

    The return ID to be set in the returned descriptor. If you pass a value of kAutoGenerateReturnID, the Apple Event Manager assigns the created Apple event a return ID that is unique to the current session. If you pass any other value, the Apple Event Manager assigns that value for the ID.

    transactionID

    The transaction ID to be set in the returned descriptor. A transaction is a sequence of Apple events that are sent back and forth between client and server applications, beginning with the client’s initial request for a service. All Apple events that are part of a transaction must have the same transaction ID. You can specify kAnyTransactionID if the Apple event is not one of a series of interdependent Apple events.

    Return Value

    A descriptor for an Apple event, initialized according to the specified parameter values, or nil if an error occurs.

    Discussion

    Constants such as kAutoGenerateReturnID and kAnyTransactionID are defined in AE.framework, a subframework of ApplicationServices.framework.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • Creates a descriptor initialized with type typeBoolean that stores the specified Boolean value.

    Declaration

    Swift

    init?(boolean boolean: Boolean) -> NSAppleEventDescriptor

    Objective-C

    + (NSAppleEventDescriptor *)descriptorWithBoolean:(Boolean)boolean

    Parameters

    boolean

    The Boolean value to be set in the returned descriptor.

    Return Value

    A descriptor with the specified Boolean value, or nil if an error occurs.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.2 and later.

  • Creates a descriptor initialized with the specified event type that stores the specified data (from a series of bytes).

    Declaration

    Objective-C

    + (NSAppleEventDescriptor *)descriptorWithDescriptorType:(DescType)descriptorType bytes:(const void *)bytes length:(NSUInteger)byteCount

    Parameters

    descriptorType

    The descriptor type to be set in the returned descriptor.

    bytes

    The data, as a sequence of bytes, to be set in the returned descriptor.

    byteCount

    The length, in bytes, of the data to be set in the returned descriptor.

    Return Value

    A descriptor with the specified type and data, or nil if an error occurs.

    Import Statement

    Availability

    Available in OS X v10.2 and later.

  • Creates a descriptor initialized with the specified event type that stores the specified data (from an instance of NSData).

    Declaration

    Objective-C

    + (NSAppleEventDescriptor *)descriptorWithDescriptorType:(DescType)descriptorType data:(NSData *)data

    Parameters

    descriptorType

    The descriptor type to be set in the returned descriptor.

    data

    The data, as an instance of NSData, to be set in the returned descriptor.

    Return Value

    A descriptor with the specified type and data, or nil if an error occurs.

    Discussion

    You can use this method to create a descriptor that you can build into a complete Apple event by calling methods such as setAttributeDescriptor:forKeyword:, setDescriptor:forKeyword:, and setParamDescriptor:forKeyword:.

    Import Statement

    Availability

    Available in OS X v10.0 and later.

  • Creates a descriptor initialized with type typeEnumerated that stores the specified enumerator data type value.

    Declaration

    Swift

    init?(enumCode enumerator: OSType) -> NSAppleEventDescriptor

    Objective-C

    + (NSAppleEventDescriptor *)descriptorWithEnumCode:(OSType)enumerator

    Parameters

    enumerator

    A type code that identifies the type of enumerated data to be stored in the returned descriptor.

    Return Value

    A descriptor with the specified enumerator data type value, or nil if an error occurs.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.2 and later.

  • Creates a descriptor initialized with Apple event type typeSInt32 that stores the specified integer value.

    Declaration

    Swift

    init?(int32 signedInt: Int32) -> NSAppleEventDescriptor

    Objective-C

    + (NSAppleEventDescriptor *)descriptorWithInt32:(SInt32)signedInt

    Parameters

    signedInt

    The integer value to be stored in the returned descriptor.

    Return Value

    A descriptor containing the specified integer value, or nil if an error occurs.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.2 and later.

  • Creates a descriptor initialized with type typeUnicodeText that stores the text from the specified string.

    Declaration

    Swift

    init?(string string: String) -> NSAppleEventDescriptor

    Objective-C

    + (NSAppleEventDescriptor *)descriptorWithString:(NSString *)string

    Parameters

    string

    A string that specifies the text to be stored in the returned descriptor.

    Return Value

    A descriptor that contains the text from the specified string, or nil if an error occurs.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.2 and later.

  • Creates a descriptor initialized with type typeType that stores the specified type value.

    Declaration

    Swift

    init?(typeCode typeCode: OSType) -> NSAppleEventDescriptor

    Objective-C

    + (NSAppleEventDescriptor *)descriptorWithTypeCode:(OSType)typeCode

    Parameters

    typeCode

    The type value to be set in the returned descriptor.

    Return Value

    A descriptor with the specified type, or nil if an error occurs.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.2 and later.

  • Creates and initializes an empty list descriptor.

    Declaration

    Swift

    class func listDescriptor() -> NSAppleEventDescriptor?

    Objective-C

    + (NSAppleEventDescriptor *)listDescriptor

    Return Value

    An empty list descriptor, or nil if an error occurs.

    Discussion

    A list descriptor is a descriptor whose data consists of one or more descriptors. You can add items to the list by calling insertDescriptor:atIndex: or remove them with removeDescriptorAtIndex:.

    Invoking this method is equivalent to allocating an instance of NSAppleEventDescriptor and invoking initListDescriptor.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • Creates and initializes a descriptor with no parameter or attribute values set.

    Declaration

    Swift

    class func nullDescriptor() -> NSAppleEventDescriptor?

    Objective-C

    + (NSAppleEventDescriptor *)nullDescriptor

    Return Value

    A descriptor with no parameter or attribute values set, or nil if an error occurs.

    Discussion

    You don’t typically call this method, as most NSAppleEventDescriptor instance methods can’t be safely called on the returned empty descriptor.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • Creates and initializes a descriptor for an Apple event record whose data has yet to be set.

    Declaration

    Swift

    class func recordDescriptor() -> NSAppleEventDescriptor?

    Objective-C

    + (NSAppleEventDescriptor *)recordDescriptor

    Return Value

    An Apple event descriptor whose data has yet to be set, or nil if an error occurs.

    Discussion

    An Apple event record is a descriptor whose data is a set of descriptors keyed by four-character codes. You can add information to the descriptor with methods such as setAttributeDescriptor:forKeyword:, setDescriptor:forKeyword:, and setParamDescriptor:forKeyword:.

    Invoking this method is equivalent to allocating an instance of NSAppleEventDescriptor and invoking initRecordDescriptor.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • Initializes a newly allocated instance as an empty list descriptor.

    Declaration

    Swift

    convenience init?(listDescriptor listDescriptor: ())

    Objective-C

    - (instancetype)initListDescriptor

    Return Value

    An empty list descriptor, or nil if an error occurs.

    Discussion

    You can add items to the empty list descriptor with insertDescriptor:atIndex:. The list indices are one-based.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • Initializes a newly allocated instance as a descriptor that is an Apple event record.

    Declaration

    Swift

    convenience init?(recordDescriptor recordDescriptor: ())

    Objective-C

    - (instancetype)initRecordDescriptor

    Return Value

    The initialized Apple event record, or nil if an error occurs.

    Discussion

    An Apple event record is a descriptor whose data is a set of descriptors keyed by four-character codes. You can add information to the descriptor with methods such as setAttributeDescriptor:forKeyword:, setDescriptor:forKeyword:, and setParamDescriptor:forKeyword:.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • Initializes a newly allocated instance as a descriptor for the specified Carbon AEDesc structure.

    Declaration

    Swift

    init(AEDescNoCopy aeDesc: UnsafePointer<AEDesc>)

    Objective-C

    - (instancetype)initWithAEDescNoCopy:(const AEDesc *)aeDesc

    Parameters

    aeDesc

    A pointer to the AEDesc structure to associate with the descriptor.

    Return Value

    An instance of NSAppleEventDescriptor that is associated with the structure pointed to by aeDesc, or nil if an error occurs.

    Discussion

    The initialized object takes responsibility for calling the AEDisposeDesc function on the AEDesc at object deallocation time. This is the designated initializer for this class.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.2 and later.

  • Initializes a newly allocated instance as a descriptor with the specified descriptor type and data (from an arbitrary sequence of bytes and a length count).

    Declaration

    Swift

    convenience init?(descriptorType descriptorType: DescType, bytes bytes: UnsafePointer<Void>, length byteCount: Int)

    Objective-C

    - (instancetype)initWithDescriptorType:(DescType)descriptorType bytes:(const void *)bytes length:(NSUInteger)byteCount

    Parameters

    descriptorType

    The descriptor type to be set in the returned descriptor.

    bytes

    The data, as a sequence of bytes, to be set in the returned descriptor.

    byteCount

    The length, in bytes, of the data to be set in the returned descriptor.

    Return Value

    An instance of NSAppleEventDescriptor with the specified type and data. Returns nil if an error occurs.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.2 and later.

  • Initializes a newly allocated instance as a descriptor with the specified descriptor type and data (from an instance of NSData).

    Declaration

    Swift

    convenience init?(descriptorType descriptorType: DescType, data data: NSData)

    Objective-C

    - (instancetype)initWithDescriptorType:(DescType)descriptorType data:(NSData *)data

    Parameters

    descriptorType

    The descriptor type to be set in the initialized descriptor.

    data

    The data to be set in the initialized descriptor.

    Return Value

    An instance of NSAppleEventDescriptor with the specified type and data. Returns nil if an error occurs.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • Initializes a newly allocated instance as a descriptor for an Apple event, initialized with the specified values.

    Declaration

    Swift

    convenience init?(eventClass eventClass: AEEventClass, eventID eventID: AEEventID, targetDescriptor addressDescriptor: NSAppleEventDescriptor?, returnID returnID: AEReturnID, transactionID transactionID: AETransactionID)

    Objective-C

    - (instancetype)initWithEventClass:(AEEventClass)eventClass eventID:(AEEventID)eventID targetDescriptor:(NSAppleEventDescriptor *)addressDescriptor returnID:(AEReturnID)returnID transactionID:(AETransactionID)transactionID

    Parameters

    eventClass

    The event class to be set in the returned descriptor.

    eventID

    The event ID to be set in the returned descriptor.

    addressDescriptor

    A pointer to a descriptor that identifies the target application for the Apple event. Passing nil results in an Apple event descriptor that has no keyAddressAttr attribute (it is valid for an Apple event to have no target address attribute).

    returnID

    The return ID to be set in the returned descriptor. If you pass a value of kAutoGenerateReturnID, the Apple Event Manager assigns the created Apple event a return ID that is unique to the current session. If you pass any other value, the Apple Event Manager assigns that value for the ID.

    transactionID

    The transaction ID to be set in the returned descriptor. A transaction is a sequence of Apple events that are sent back and forth between client and server applications, beginning with the client’s initial request for a service. All Apple events that are part of a transaction must have the same transaction ID. You can specify kAnyTransactionID if the Apple event is not one of a series of interdependent Apple events.

    Return Value

    The initialized Apple event (an instance of NSAppleEventDescriptor), or nil if an error occurs.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • aeDesc aeDesc Property

    The AEDesc structure encapsulated by the receiver, if it has one. (read-only)

    Declaration

    Swift

    var aeDesc: UnsafePointer<AEDesc> { get }

    Objective-C

    @property(readonly) const AEDesc *aeDesc

    Discussion

    If the receiver has a valid AEDesc structure, returns a pointer to it; otherwise returns nil.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.2 and later.

  • The contents of the receiver as a Boolean value, coercing (to typeBoolean) if necessary. (read-only)

    Declaration

    Swift

    var booleanValue: Boolean { get }

    Objective-C

    @property(readonly) Boolean booleanValue

    Discussion

    The contents of the descriptor, as a Boolean value, or false if an error occurs.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.2 and later.

  • Returns a descriptor obtained by coercing the receiver to the specified type.

    Declaration

    Swift

    func coerceToDescriptorType(_ descriptorType: DescType) -> NSAppleEventDescriptor?

    Objective-C

    - (NSAppleEventDescriptor *)coerceToDescriptorType:(DescType)descriptorType

    Parameters

    descriptorType

    The descriptor type to coerce the receiver to.

    Return Value

    A descriptor of the specified type, or nil if an error occurs.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • data data Property

    The receiver’s data. (read-only)

    Declaration

    Swift

    @NSCopying var data: NSData { get }

    Objective-C

    @property(readonly, copy) NSData *data

    Discussion

    An instance of NSData containing the receiver’s data, or nil if an error occurs.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • The descriptor type of the receiver. (read-only)

    Declaration

    Swift

    var descriptorType: DescType { get }

    Objective-C

    @property(readonly) DescType descriptorType

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • The contents of the receiver as an enumeration type, coercing to typeEnumerated if necessary.

    Declaration

    Swift

    var enumCodeValue: OSType { get }

    Objective-C

    @property(readonly) OSType enumCodeValue

    Discussion

    The contents of the descriptor, as an enumeration type, or 0 if an error occurs.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.2 and later.

  • The contents of the receiver as an integer, coercing (to typeSInt32) if necessary. (read-only)

    Declaration

    Swift

    var int32Value: Int32 { get }

    Objective-C

    @property(readonly) SInt32 int32Value

    Discussion

    The contents of the descriptor, as an integer value, or 0 if an error occurs.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.2 and later.

  • The number of descriptors in the receiver’s descriptor list. (read-only)

    Declaration

    Swift

    var numberOfItems: Int { get }

    Objective-C

    @property(readonly) NSInteger numberOfItems

    Discussion

    The number of descriptors in the receiver’s descriptor list (possibly 0); returns 0 if an error occurs.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • The contents of the receiver as a Unicode text string, coercing to typeUnicodeText if necessary. (read-only)

    Declaration

    Swift

    var stringValue: String? { get }

    Objective-C

    @property(readonly, copy) NSString *stringValue

    Discussion

    The contents of the descriptor, as a string, or nil if an error occurs.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.2 and later.

  • The contents of the receiver as a type, coercing to typeType if necessary. (read-only)

    Declaration

    Swift

    var typeCodeValue: OSType { get }

    Objective-C

    @property(readonly) OSType typeCodeValue

    Discussion

    The contents of the descriptor, as a type, or 0 if an error occurs.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.2 and later.

  • Returns the descriptor at the specified (one-based) position in the receiving descriptor list.

    Declaration

    Swift

    func descriptorAtIndex(_ anIndex: Int) -> NSAppleEventDescriptor?

    Objective-C

    - (NSAppleEventDescriptor *)descriptorAtIndex:(NSInteger)anIndex

    Parameters

    anIndex

    The one-based descriptor list position of the descriptor to return.

    Return Value

    The descriptor from the specified position (one-based) in the descriptor list, or nil if the specified descriptor cannot be obtained.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • Inserts a descriptor at the specified (one-based) position in the receiving descriptor list, replacing the existing descriptor, if any, at that position.

    Declaration

    Swift

    func insertDescriptor(_ descriptor: NSAppleEventDescriptor, atIndex anIndex: Int)

    Objective-C

    - (void)insertDescriptor:(NSAppleEventDescriptor *)descriptor atIndex:(NSInteger)anIndex

    Parameters

    descriptor

    The descriptor to insert in the receiver. Specifying an index of 0 or count + 1 causes appending to the end of the list.

    anIndex

    The one-based descriptor list position at which to insert the descriptor.

    Discussion

    Because it actually replaces the descriptor, if any, at the specified position, this method might better be called replaceDescriptor:atIndex:. The receiver must be a list descriptor. The indices are one-based. Currently provides no indication if an error occurs.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • Removes the descriptor at the specified (one-based) position in the receiving descriptor list.

    Declaration

    Swift

    func removeDescriptorAtIndex(_ anIndex: Int)

    Objective-C

    - (void)removeDescriptorAtIndex:(NSInteger)anIndex

    Parameters

    anIndex

    The one-based position of the descriptor to remove.

    Discussion

    The receiver must be a list descriptor. The indices are one-based. Currently provides no indication if an error occurs.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.2 and later.

  • Returns the receiver’s descriptor for the specified keyword.

    Declaration

    Swift

    func descriptorForKeyword(_ keyword: AEKeyword) -> NSAppleEventDescriptor?

    Objective-C

    - (NSAppleEventDescriptor *)descriptorForKeyword:(AEKeyword)keyword

    Parameters

    keyword

    A keyword (a four-character code) that identifies the descriptor to obtain.

    Return Value

    A descriptor for the specified keyword, or nil if an error occurs.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • Returns the keyword for the descriptor at the specified (one-based) position in the receiver.

    Declaration

    Swift

    func keywordForDescriptorAtIndex(_ anIndex: Int) -> AEKeyword

    Objective-C

    - (AEKeyword)keywordForDescriptorAtIndex:(NSInteger)anIndex

    Parameters

    anIndex

    The one-based descriptor list position of the descriptor to get the keyword for.

    Return Value

    The keyword (a four-character code) for the descriptor at the one-based location specified by anIndex, or 0 if an error occurs.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • Removes the receiver’s descriptor identified by the specified keyword.

    Declaration

    Swift

    func removeDescriptorWithKeyword(_ keyword: AEKeyword)

    Objective-C

    - (void)removeDescriptorWithKeyword:(AEKeyword)keyword

    Parameters

    keyword

    A keyword (a four-character code) that identifies the descriptor to remove.

    Discussion

    The receiver must be an Apple event or Apple event record. Currently provides no indication if an error occurs.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • Adds a descriptor, identified by a keyword, to the receiver.

    Declaration

    Swift

    func setDescriptor(_ descriptor: NSAppleEventDescriptor, forKeyword keyword: AEKeyword)

    Objective-C

    - (void)setDescriptor:(NSAppleEventDescriptor *)descriptor forKeyword:(AEKeyword)keyword

    Parameters

    descriptor

    The descriptor to add to the receiver.

    keyword

    A keyword (a four-character code) that identifies the descriptor to add. If a descriptor with that keyword already exists in the receiver, it is replaced.

    Discussion

    The receiver must be an Apple event or Apple event record. Currently provides no indication if an error occurs.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • Returns a descriptor for the receiver’s Apple event attribute identified by the specified keyword.

    Declaration

    Swift

    func attributeDescriptorForKeyword(_ keyword: AEKeyword) -> NSAppleEventDescriptor?

    Objective-C

    - (NSAppleEventDescriptor *)attributeDescriptorForKeyword:(AEKeyword)keyword

    Parameters

    keyword

    A keyword (a four-character code) that identifies the descriptor to obtain.

    Return Value

    The attribute descriptor for the specified keyword, or nil if an error occurs.

    Discussion

    The receiver must be an Apple event.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • The event class for the receiver. (read-only)

    Declaration

    Swift

    var eventClass: AEEventClass { get }

    Objective-C

    @property(readonly) AEEventClass eventClass

    Discussion

    The event class (a four-character code) for the receiver, or 0 if an error occurs.

    The receiver must be an Apple event. An Apple event is identified by its event class and event ID, a pair of four-character codes stored as 32-bit integers. For example, most events in the Standard suite have the four-character code 'core' (defined as the constant kAECoreSuite in AE.framework, a subframework of ApplicationServices.framework). For more information on event classes and event IDs, see Building an Apple Event in Apple Events Programming Guide.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • eventID eventID Property

    The event ID for the receiver. (read-only)

    Declaration

    Swift

    var eventID: AEEventID { get }

    Objective-C

    @property(readonly) AEEventID eventID

    Discussion

    The event ID (a four-character code) for the receiver, or 0 if an error occurs.

    The receiver must be an Apple event. An Apple event is identified by its event class and event ID, a pair of four-character codes stored as 32-bit integers. For example, the open Apple event from the Standard suite has the four-character code 'odoc' (defined as the constant kAEOpen in AE.framework, a subframework of ApplicationServices.framework).

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • Returns a descriptor for the receiver’s Apple event parameter identified by the specified keyword.

    Declaration

    Swift

    func paramDescriptorForKeyword(_ keyword: AEKeyword) -> NSAppleEventDescriptor?

    Objective-C

    - (NSAppleEventDescriptor *)paramDescriptorForKeyword:(AEKeyword)keyword

    Parameters

    keyword

    A keyword (a four-character code) that identifies the parameter descriptor to obtain.

    Return Value

    A descriptor for the specified keyword, or nil if an error occurs.

    Discussion

    The receiver must be an Apple event.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • Removes the receiver’s parameter descriptor identified by the specified keyword.

    Declaration

    Swift

    func removeParamDescriptorWithKeyword(_ keyword: AEKeyword)

    Objective-C

    - (void)removeParamDescriptorWithKeyword:(AEKeyword)keyword

    Parameters

    keyword

    A keyword (a four-character code) that identifies the parameter descriptor to remove. Currently provides no indication if an error occurs.

    Discussion

    The receiver must be an Apple event or Apple event record, both of which can contain parameters.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • returnID returnID Property

    The receiver’s return ID (the ID for a reply Apple event). (read-only)

    Declaration

    Swift

    var returnID: AEReturnID { get }

    Objective-C

    @property(readonly) AEReturnID returnID

    Discussion

    The receiver’s return ID (an integer value), or 0 if an error occurs.

    The receiver must be an Apple event.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • Adds a descriptor to the receiver as an attribute identified by the specified keyword.

    Declaration

    Swift

    func setAttributeDescriptor(_ descriptor: NSAppleEventDescriptor, forKeyword keyword: AEKeyword)

    Objective-C

    - (void)setAttributeDescriptor:(NSAppleEventDescriptor *)descriptor forKeyword:(AEKeyword)keyword

    Parameters

    descriptor

    The attribute descriptor to add to the receiver.

    keyword

    A keyword (a four-character code) that identifies the attribute descriptor to add. If a descriptor with that keyword already exists in the receiver, it is replaced.

    Discussion

    The receiver must be an Apple event. Currently provides no indication if an error occurs.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • Adds a descriptor to the receiver as an Apple event parameter identified by the specified keyword.

    Declaration

    Swift

    func setParamDescriptor(_ descriptor: NSAppleEventDescriptor, forKeyword keyword: AEKeyword)

    Objective-C

    - (void)setParamDescriptor:(NSAppleEventDescriptor *)descriptor forKeyword:(AEKeyword)keyword

    Parameters

    descriptor

    The parameter descriptor to add to the receiver.

    keyword

    A keyword (a four-character code) that identifies the parameter descriptor to add. If a descriptor with that keyword already exists in the receiver, it is replaced.

    Discussion

    The receiver must be an Apple event or Apple event record, both of which can contain parameters.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

  • The receiver’s transaction ID, if any. (read-only)

    Declaration

    Swift

    var transactionID: AETransactionID { get }

    Objective-C

    @property(readonly) AETransactionID transactionID

    Discussion

    The receiver’s transaction ID (an integer value), or 0 if an error occurs.

    The receiver must be an Apple event. Currently provides no indication if an error occurs. For more information on transactions, see the description for appleEventWithEventClass:eventID:targetDescriptor:returnID:transactionID:.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.