Allows you to encapsulate calls to AEBuildAppleEvent in a wrapper routine.


OSStatus vAEBuildAppleEvent(AEEventClass theClass, AEEventID theID, DescType addressType, const void *addressData, Size addressLength, SInt16 returnID, SInt32 transactionID, AppleEvent *resultEvt, AEBuildError *error, const char *paramsFmt, va_list args);



The event class for the resulting Apple event. See AEEventClass.


The event id for the resulting Apple event. See AEEventID.


The address type for the addressing information described in the next two parameters: usually one of typeApplSignature, typeProcessSerialNumber, or typeKernelProcessID. See DescType.


A pointer to the address information.


The number of bytes pointed to by the addressData parameter.


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 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.


A pointer to a descriptor where the resulting descriptor should be stored. See AppleEvent for a description of the data type.


A pointer to an AEBuildError structure where additional information about any errors that occur will be saved. This is an optional parameter and you can pass NULL if this information is not required. See AEBuildErrorCode for the syntax error codes that can be returned in this structure.


An AEBuild format string describing the AppleEvent record to be created. The format of these strings is described in Technical Note TN2106, AEBuild*, AEPrint*, and Friends.


A variable array of arguments to be substituted into the paramsFmt format string. See the ANSI C Interfaces documentation for a description of the va_list data type.

Return Value

A result code. See Result Codes.


Passing an argument list to vAEBuildAppleEvent corresponds to passing a series of individual parameters to the AEBuildAppleEvent function.

This function and related “AEBuild” routines provide a very simple translation service for converting specially formatted strings into complex Apple event descriptors. Normally, creating complex Apple event descriptors requires a large number of calls to Apple event Manager routines to build up the descriptor piece by piece. The vAEBuildAppleEvent function and related routines allow you to consolidate all of the calls required to construct a complex Apple event descriptor into a single system call that creates the desired structure as directed by a format string that you provide.

See Also

Creating Apple Event Structures in Memory


Constructs an entire Apple event in a single call.


Provides a facility for compiling AEBuild descriptor strings into Apple event descriptors (AEDesc).


Adds additional parameters or attributes to an existing Apple event.


Provides a pretty printer facility for displaying the contents of Apple event descriptors.


Allows you to encapsulate calls to AEBuildDesc in your own wrapper routines.


Allows you to encapsulate calls to AEBuildParameters in your own stdarg-style wrapper routines, using techniques similar to those allowed by vsprintf.