Carbon


AECreateAppleEvent

Header: AEDataModel.h Carbon status: Supported

Creates an Apple event with several important attributes but no parameters.

OSErr AECreateAppleEvent (
    AEEventClass theAEEventClass, 
    AEEventID theAEEventID, 
    const AEAddressDesc *target, 
    AEReturnID returnID, 
    AETransactionID transactionID, 
    AppleEvent *result
);
Parameter descriptions
theAEEventClass

The event class of the Apple event to create. Some event classes are described in “Event Class Constants”.

theAEEventID

The event ID of the Apple event to create. Some event IDs are described in “Event ID Constants”.

target

A pointer to an address descriptor. Before calling AECreateAppleEvent, you set the descriptor to identify the target (or server) application for the Apple event.

returnID

The return ID for the created Apple event. 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. The return ID constant is described in “ID Constants for the AECreateAppleEvent Function”.

transactionID

The transaction ID for this Apple event. A transaction is a sequence of Apple events that are sent back and forth between the 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 the kAnyTransactionID constant if the Apple event is not one of a series of interdependent Apple events. This transaction ID constant is described in “ID Constants for the AECreateAppleEvent Function”.

result

A pointer to an Apple event. On successful return, the new Apple event. On error, a null descriptor. Your application should always call the AEDisposeDesc function to dispose of the resulting Apple event after it has finished using it.

function result

A result code.

DISCUSSION

The AECreateAppleEvent function creates an empty Apple event. You can add parameters to the Apple event after you create it with the functions described in “Adding Data and Descriptor Records to an AE Record or an Apple Event Record” and “Adding Parameters and Attributes to an Apple Event”.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)