The Text suite defines terminology that allows scripts to request or select textual elements at different levels of granularity: character, word, paragraph, or entire body of text. The NSTextStorage class, provided by the Application Kit, defines a corresponding set of methods for getting and setting scriptable properties of NSTextStorage objects.
To gain access to this text scripting support, use an NSTextStorage object as the content for one of your scriptable classes. The TextEdit sample code (available at <Xcode>/Examples/AppKit/TextEdit) demonstrates a scriptable application that supports text scripting, as well as scripting support for printing.
Note: The TextEdit sample does not use the sdef file format—it supplies its scriptability information using the older style script suite and script terminology files.
Table 3-2 lists Cocoa classes for working with text, along with attributes and relationships used by those classes.
Class | Attributes (script term, if different) | Relationships |
|---|---|---|
font name ( | attribute runs, characters, paragraphs, text, words |
Last updated: 2008-03-11