This appendix lists the type conversions performed by the default coercion handlers provided by the Mac OS. These handlers may be implemented by the Apple Event Manager, the Open Scripting framework, or other frameworks.
Support for the following coercions was added in Mac OS X version 10.4:
Between these types:
typeStyledText
, typeUnicodeText
, typeUTF8Text
, and typeUTF16ExternalRepresentation
and these types:
typeType
, typeEnumerated
, and the numeric types typeSInt16
, typeSInt32
, typeUInt32
, typeSInt64
, typeIEEE32BitFloatingPoint
, typeIEEE64BitFloatingPoint
, and typeExtended
.
Important: See the description for the typePixelMap
enum in Apple Event Manager Reference for important information about restrictions on coercions involving typeStyledText.
See table Table C-1 for a mapping between the preferred and non-preferred numeric constant names.
From typeChar
to typeStyledText
.
Note: Starting in Mac OS X version 10.3, typeChar
is deprecated in favor of one of the Unicode string types. For details, see the descriptions for typeChar
and for the Unicode string types (typeUnicodeText
) in Apple Event Manager Reference.
Table C-1 shows some older, non-preferred numeric constant names and their preferred equivalents. To find available coercions for a non-preferred name from Table C-1, look up its equivalent preferred name in Table C-2.
Non-preferred numeric constant name | Preferred numeric constant name |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Table C-2 lists the default coercions handled by the Apple Event Manager.
Coerce from descriptor type | To descriptor type | Comment |
---|---|---|
|
| Any string that is a valid representation of a number can be coerced into an equivalent numeric value. |
|
| Any numeric descriptor type can be coerced into the equivalent text string. |
|
| Any numeric descriptor type can be coerced into any other numeric descriptor type. |
|
| If the destination encoding cannot represent a character in the source text, the result is undefined. |
|
| Any four-character string can be coerced to one of these descriptor types. |
|
| Any of these descriptor types can be coerced to the equivalent text string. |
|
| The result contains text only, without the script code or language code from the original descriptor. |
|
| The result is the Boolean value |
|
| The result is the Boolean value |
|
| The enumerated value |
|
| The Boolean value |
|
| A value of 1 becomes the Boolean value |
|
| A value of |
|
| An alias is coerced into a file system specification. Not recommended—use |
|
| An alias is coerced into a file system reference. |
|
| An Apple event is coerced into a list of application parameters for the |
any descriptor type |
| A descriptor is coerced into a descriptor list containing a single item. |
| type of list item | A descriptor list containing a single descriptor is coerced into a descriptor. |
© 2005, 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-10-31)