Important: The information in this document is obsolete and should not be used for new development.
Descriptor Records and Related Data Structures
Descriptor records are the fundamental data structures from which Apple events are constructed. A descriptor record is a data structure of typeAEDesc
.
TYPE AEDesc = RECORD {descriptor record} descriptorType: DescType; {type of data being passed} dataHandle: Handle; {handle to data being passed} END;The descriptor type is a structure of type
Field Description
descriptorType
- A four-character string of type
DescType
that indicates the type of data being passed.dataHandle
- A handle to the data being passed.
DescType
, which in turn is of data typeResType
--that is, a four-character code. Constants, rather than these four-character codes, are usually used to refer to descriptor types. Table 4-2 lists the constants for the basic descriptor types used by the Apple Event Manager.For information about descriptor records and descriptor types used with object specifier records, see the chapter "Resolving and Creating Object Specifier Records" in this book.
Apple event attributes, Apple event parameters, object specifier records, tokens, and most of the other data structures used by the Apple Event Manager are constructed from one or more descriptor records. The Apple Event Manager identifies the various parts of an Apple event by means of keywords associated with the corresponding descriptor records. The
AEKeyword
data type is defined as a four-character code.
TYPE AEKeyword = PACKED ARRAY[1..4] OF Char;Constants are typically used for keywords. A keyword combined with a descriptor record forms a keyword-specified descriptor record, which is defined by a data structure of typeAEKeyDesc
.
TYPE AEKeyDesc = RECORD descKey: AEKeyword; {keyword} descContent: AEDesc; {descriptor record} END;Every Apple event includes an attribute that contains the address of the target application. A descriptor record that contains an application's address is called an address descriptor record.
Field Description
descKey
- A four-character code of type
AEKeyword
that identifies the data in thedescContent
field.descContent
- A descriptor record of type
AEDesc
.
TYPE AEAddressDesc = AEDesc; {address descriptor record}Many Apple Event Manager functions take or return lists of descriptor records in a special descriptor record called a descriptor list. A descriptor list is a structure of data typeAEDescList
whose data consists of a list of other descriptor records.
TYPE AEDescList = AEDesc; {list of descriptor records}Other Apple Event Manager functions take or return lists of keyword-specified descriptor records in the form of an AE record. An AE record is a structure of data typeAERecord
whose data handle refers to a list of keyword-specified descriptor records.
TYPE AERecord = AEDescList; {list of keyword-specified } { descriptor records}The handle for a descriptor list of data typeAERecord
refers to a list of keyword-specified descriptor records that specify Apple event parameters; they cannot specify Apple event attributes.Finally, a full-fledged Apple event, including both attributes and parameters, is an Apple event record, which is a structure of data type
AppleEvent
.
TYPE AppleEvent = AERecord; {list of attributes and } { parameters for an Apple } { event}The event class and event ID of an Apple event are specified in Apple Event Manager routines by structures of data typesAEEventClass
andAEEventID
, respectively.
TYPE AEEventClass = PACKED ARRAY[1..4] OF Char; TYPE AEEventID = PACKED ARRAY[1..4] OF Char;For more information about descriptor records and the other data structures described in this section, see "Data Structures Within Apple Events," which begins on page 3-10.With the exception of array data records, which are described in the next section, the other Apple Event Manager data structures used in responding to Apple events are described in "Routines for Responding to Apple Events," beginning on page 4-62, under the descriptions of the routines that use them.