AEPutArray(_:_:_:_:_:_:)
Inserts the data for an Apple event array into a descriptor list, replacing any previous descriptors in the list.
Declaration
func AEPutArray(_ theAEDescList: UnsafeMutablePointer<AEDescList>!, _ arrayType: AEArrayType, _ arrayPtr: UnsafePointer<AEArrayData>!, _ itemType: DescType, _ itemSize: Size, _ itemCount: Int) -> OSErrParameters
- theAEDescList:
A pointer to the descriptor list to put the Apple event array into. If there are any descriptors already in the descriptor list, they are replaced. If the array type is
kAEKeyDescArray,theAEDescListmust point to an Apple event record; otherwise, it can point to either a descriptor list or an Apple event record.If you pass a pointer to a factored descriptor list, created by calling the 1448643 Aecreatelist function, each array item in the array pointed to by the
arrayPtrparameter must include the data that is common to all the descriptors in the list. The Apple Event Manager automatically isolates the common data you specified in the call toAECreateList. A factored descriptor list is described in the Discussion section.See Aedesclist.
- arrayType:
The Apple event array type to create. Pass a value specified by one of the constants described in 1542848 Data_array_constants. See Aearraytype.
- arrayPtr:
A pointer to a buffer, local variable, or other storage location, created and disposed of by your application, that contains the array to put into the descriptor list. See Aearraydata.
- itemType:
For arrays of type
kAEDataArray,kAEPackedArray, orkAEHandleArray, the descriptor type of the array items to create. Use one of the constants described in 1542788 Descriptor_type_constants, such astypeLongInteger. You don’t need to specify an item type for arrays of typekAEDescArrayorkAEKeyDescArraybecause the data is already stored in descriptors which contain a descriptor type. See Desctype. - itemSize:
For arrays of type
kAEDataArrayorkAEPackedArray, the size (in bytes) of the array items to create. You don’t need to specify an item size for arrays of typekAEDescArray,kAEKeyDescArray, orkAEHandleArraybecause their descriptors (though not the data they point to) have a known size. - itemCount:
The number of elements in the array.
Return Value
A result code. See Result Codes.
Discussion
A factored descriptor list is one in which the Apple Event Manager automatically isolates the data that is common to all the elements of the list so that the common data only appears in the list once. To create a factored descriptor list, you call the AECreateList(_:_:_:_:) function and specify the data that is common to all elements in the descriptor array.
Version-Notes
Thread safe starting in OS X v10.2.