Coerces data to a desired descriptor type and creates a descriptor containing the newly coerced data.
- macOS 10.0+
- Core Services
A pointer to the data to coerce.
The length, in bytes, of the data to coerce.
The desired descriptor type of the resulting descriptor. For a list of AppleScript’s predefined descriptor types, see Descriptor Type Constants.
A pointer to a descriptor. On successful return, a descriptor containing the coerced data and matching the descriptor type specified in
to. On error, a null descriptor. If the function returns successfully, your application should call the
AEDisposefunction to dispose of the resulting descriptor after it has finished using it. See
A result code. See Result Codes.
Starting in OS X version 10.2, pointer-based coercion handlers are not called if the input type is “structured”—that is, if the type to be coerced is
type, or coerced
type. If you want to add a coercion handler for one of these types, it must be a descriptor-based handler. This does not mean you are required to use descriptor-based coercion handlers everywhere—for “flat” data types, such as
type, pointer-based handlers are still fine.
Thread safe starting in OS X v10.2.