Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Interapplication Communication /
Chapter 10 - Scripting Components / Scripting Components Reference
AppleScript Component Routines / Getting and Setting Styles for Source Data


ASGetSourceStyles

You can use the ASGetSourceStyles function 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 OpenDefaultComponent or OpenComponent (see page 10-4).
resultingSourceStyles
A handle to a style element array defined by the TextEdit data type TEStyleTable that defines the styles used for different kinds of AppleScript terms.
DESCRIPTION
The ASGetSourceStyles function 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 resultingSourceStyles parameter:

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
noErr0No error
errOSASystemError-1750General scripting system error
badComponentInstance$80008001Invalid component instance
SEE ALSO
For information about the TEStyleTable array, see Inside Macintosh: Text.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996