Gets a copy of the data from a descriptor at a specified position in a descriptor list; typically used when your application needs to work with the extracted data directly.
- macOS 10.0+
- Core Services
A pointer to the descriptor list that contains the descriptor. See
A one-based positive integer indicating the position in the descriptor list of the descriptor to get the data from.
AEGetreturns an error if you pass zero, a negative number, or a value that is out of range.
The desired descriptor type for the copied data. For a list of AppleScript’s predefined descriptor types, see Descriptor Type Constants.
If the descriptor specified by the
indexparameter is not of the desired type,
AEGetattempts to coerce the data to this type. If you pass a value of
type, no coercion is performed, and the descriptor type of the copied data is the same as the descriptor type of the original descriptor.
A pointer to a keyword. On return, the keyword for the specified descriptor, if you are getting data from a list of keyword-specified descriptors; otherwise,
AEGetreturns the value
type. Some keyword constants are described in Keyword Attribute Constants and Keyword Parameter Constants. See
A pointer to a descriptor type. On return, specifies the descriptor type of the data pointed to by
data. For a list of AppleScript’s predefined descriptor types, see Descriptor Type Constants.
A pointer to a buffer, local variable, or other storage location created and disposed of by your application. The size in bytes must be at least as large as the value you pass in the
maximumparameter. On return, contains the data from the descriptor at the position in the descriptor list specified by the
The maximum length, in bytes, of the expected data. The
AEGetfunction will not return more data than you specify in this parameter.
A pointer to a size variable. On return, the length, in bytes, of the data for the specified descriptor. If this value is larger than the value of the
maximumparameter, the buffer pointed to by
datawas not large enough to contain all of the data for the descriptor, though
AEGetdoes not write beyond the end of the buffer. If the buffer was too small, you can resize it and call
A result code. See Result Codes.
AEGet function uses a buffer to return the data for a specified descriptor from a specified descriptor list. The function attempts to coerce the descriptor to the descriptor type specified by the
AEGet, you can call the
AESize function to determine a size for the
data buffer. However, unless you specify
type for the
AESizem may coerce the data, which may cause the size of the data to change. If you are using
AEGet to iterate through a list of descriptors of the same type with a fixed size, such as a list of descriptors of type
type, you can get the size once, allocate a buffer, and reuse it for each call.
The order of items in an Apple event record may change after an insertion or deletion. In addition, duplicating an Apple event record is not guaranteed to preserve the item order.
Thread safe starting in OS X v10.2.