Skip to content

Story

story

A contiguous block of text as specified by a text range. A story can contain one or more text frames; if there is more than one, the multiple text frames are linked together to form a single story.


story.characters

All the characters in this story.

Characters; read-only.


story.insertionPoints

All the insertion points in this story.

InsertionPoints; read-only.


story.length

The number of characters in the story.

Number (long); read-only.


story.lines

All the lines in this story.

Lines; read-only.


story.paragraphs

All the paragraphs in this story.

Paragraphs; read-only.


story.parent

The object’s container.

Object; read-only.


story.textFrames

The text frame items in this story.

TextFrameItems; read-only.


story.textRange

The text range of the story.

TextRange; read-only.


story.textRanges

All the text ranges in the story.

TextRanges; read-only.


story.textSelection

The selected text ranges in the story.

Array of TextRange; read-only.


story.typename

The class name of the object.

String; read-only.


story.words

All the words in the story.

Words; read-only.


// Creates 1 story that flows through 2 text frames and another story that
// is displayed in a 3rd text frame
// Create a new document and add 2 area TextFrames
var docRef = documents.add();
var itemRef1 = docRef.pathItems.rectangle(600, 200, 50, 30);
var textRef1 = docRef.textFrames.areaText(itemRef1);
textRef1.selected = true;
// create 2nd text frame and link it the first
var itemRef2 = docRef.pathItems.rectangle(550, 300, 50, 200);
var textRef2 = docRef.textFrames.areaText(itemRef2, TextOrientation.HORIZONTAL, textRef1);
textRef2.selected = true;
// Add enough text to the 1st TextFrame to
// cause it to flow to the 2nd TextFrame.
textRef1.contents = "This is two text frames linked together as one story";
redraw();
// Create a 3rd text frame and count the stories
var textRef3 = docRef.textFrames.add();
textRef3.contents = "Each unlinked textFrame adds a new story."
textRef3.top = 650;
textRef3.left = 200;
redraw();