Adobe 65010248 Scripting Guide - Page 23

Text ranges, Text styles

Page 23 highlights

CHAPTER 2: The Illustrator Scripting Object Model Text objects 23 Both text frame and story objects have insertion point and text selection properties. The text frame object's properties also include the defining features of the text frame, such as: ➤ The frame width, height, and position ➤ Whether the frame is hidden or locked ➤ Whether the text is editable NOTE: A line object cannot be created in a script. Your script can create character, paragraph, and word objects. Text ranges The various text objects within a text frame or story also are represented collectively by the text range object. For example, a character is a text range with a length of 1, and a word is a text range that has a space before it. You can set the content of a text range object by passing a string using the contents property. Text styles Text-style elements, like font, capitalization, and justification, are represented by paragraph attribute and character attribute objects. These attribute objects are properties of the paragraph style and character style objects. The paragraph style and character style objects have apply to and remove methods that allow your script to assign or remove attributes in a specific paragraph, character, or text range. You can change the display properties of a text range by applying an appropriate style or providing local overrides of attributes at the text or paragraph levels: ➤ character style objects apply to sets of one or more characters. They control character features like font, alignment, leading, language, and capitalization, which are properties of the character attribute object. ➤ paragraph style objects apply to paragraphs. They control paragraph features like first line indent, left indent, and right indent, which are properties of the paragraph attribute object.

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57

C
HAPTER
2: The Illustrator Scripting Object Model
Text objects
23
Both
text
frame
and
story
objects have
insertion
point
and
text
selection
properties. The
text
frame
object’s properties also include the defining features of the text frame, such as:
The frame
width
,
height
, and
position
Whether the frame is
hidden
or
locked
Whether the text is
editable
N
OTE
:
A
line
object cannot be created in a script. Your script can create
character
,
paragraph
, and
word
objects.
Text ranges
The various text objects within a text frame or story also are represented collectively by the
text
range
object. For example, a character is a text range with a length of 1, and a word is a text range that has a
space before it.
You can set the content of a
text
range
object by passing a string using the
contents
property.
Text styles
Text-style elements, like
font
,
capitalization
, and
justification
, are represented by
paragraph
attribute
and
character
attribute
objects. These attribute objects are properties of the
paragraph
style
and
character
style
objects. The
paragraph
style
and
character
style
objects have
apply
to
and
remove
methods that allow your script to assign or remove attributes in a specific paragraph,
character, or text range.
You can change the display properties of a text range by applying an appropriate style or providing local
overrides of attributes at the text or paragraph levels:
character
style
objects apply to sets of one or more characters. They control character features like
font
,
alignment
,
leading
,
language
, and
capitalization
, which are properties of the
characterattribute
object.
paragraph
style
objects apply to paragraphs. They control paragraph features like
first
line
indent
,
left
indent
, and
right
indent
, which are properties of the
paragraph
attribute
object.