Saturday, October 29, 2011

Working with Text

Sooner or later, you are likely to write a script that works with text. Some things you might want to do are:
  • Determine the content of a range of text.
  • Add text to a document.
  • Remove text from a document.
  • Alter the formatting of text.
  • Work with objects that are anchored in text such as tables, markers, or graphic.
Where is text found?
Lots of places including:
  • table cells
  • structure elements
  • flows
  • footnotes
  • paragraphs
  • text frames
  • text lines
  • sub columns
  • text insets of various types
  • variables
  • cross references
What is found in text?
Text contains the alphabetic, numeric, and special characters that make up document content. But text can also contain anchored objects. Those are the tables, anchored frames, markers, cross references that can be inserted at locations between characters.

Text is different
Text, unlike documents, paragraphs, graphics and just about everything else that makes up a FrameMaker document is not an object. There is no FO_Text object. Instead, text within paragraphs, text lines and other objects that contain text are processed as text items. (The details will be the subject of a later post.)

Text is formatted
Text all appears in a given font, at a particular size and style. It contains line breaks and page breaks and other information that reflects how it looks on the page. When you work with text, you will need to be able to determine how it is formatted and, if desired, change that formatting. Text items also give you the information needed to tackle those tasks.

Locations and Ranges
To work with text, you need to understand the concepts of text location and text range. You can think of a text location as analogous to an insertion point and a text range as analogous to a text selection. (But a text range can be selected or not selected!)

    No comments:

    Post a Comment