Carbon


AEDuplicateDesc

Header: AEDataModel.h Carbon status: Supported

Creates a copy of a descriptor record.

OSErr AEDuplicateDesc (
    const AEDesc *theAEDesc, 
    AEDesc *result
);
Parameter descriptions
theAEDesc

A pointer to the descriptor record to duplicate.

result

A pointer to a descriptor record. On return, the descriptor contains a copy of the descriptor specified by the theAEDesc parameter. Your application should always call the AEDisposeDesc function to dispose of the resulting descriptor record after it has finished using it.

function result

A result code.

DISCUSSION

It is common for applications to send Apple events that have one or more attributes or parameters in common. For example, if you send a series of Apple events to the same application, the address attribute is the same. In these cases, the most efficient way to create the necessary Apple events is to make a template Apple event that you can then copy—by calling the AEDuplicateDesc function—as needed. You then fill in or change the remaining parameters and attributes of the copy, send the copy by calling the AESend function and, after AESend returns a result code, dispose of the copy by calling AEDisposeDesc. You can use this approach to prepare structures of type AEDesc, AEDescList, AERecord, and AppleEvent.

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)