Important: The information in this document is obsolete and should not be used for new development.
ASGetSourceStyles
You can use theASGetSourceStylesfunction to get the script format styles currently used by the AppleScript component to display scripts.
FUNCTION ASGetSourceStyles (scriptingComponent: ComponentInstance; VAR resultingSourceStyles: STHandle): OSAError;
scriptingComponent- A component instance created by a prior call to the Component Manager function
OpenDefaultComponentorOpenComponent(see page 10-4).resultingSourceStyles- A handle to a style element array defined by the TextEdit data type
TEStyleTablethat defines the styles used for different kinds of AppleScript terms.DESCRIPTION
TheASGetSourceStylesfunction returns a style element array that defines the nine styles used for AppleScript terms.You can use these index constants to identify individual styles returned in the
resultingSourceStylesparameter:
CONST kASSourceStyleUncompiledText = 0; kASSourceStyleNormalText = 1; kASSourceStyleLanguageKeyword = 2; kASSourceStyleApplicationKeyword = 3; kASSourceStyleComment = 4; kASSourceStyleLiteral = 5; kASSourceStyleUserSymbol = 6; kASSourceStyleObjectSpecifier = 7; kASNumberOfSourceStyles = 8;Other AppleScript dialects may define additional styles. When you have finished using the style element array, you must dispose of it.RESULT CODES
noErr 0 No error errOSASystemError -1750 General scripting system error badComponentInstance $80008001 Invalid component instance SEE ALSO
For information about theTEStyleTablearray, see Inside Macintosh: Text.