Text And Type; Entering And Importing Text; Stories And Text Frames; Adding Text To A Story - Adobe 65009333 - InCopy CS4 - PC Manual

Scripting guide: javascript
Hide thumbs Also See for 65009333 - InCopy CS4 - PC:
Table of Contents

Advertisement

4

Text and Type

Entering, editing, and formatting text make up the bulk of the time spent working on most InCopy
documents. As a result, automating text and type operations can result in large productivity gains.
This tutorial shows how to script the most common operations involving text and type. The sample scripts
in this chapter are presented in order of complexity, starting with very simple scripts and building toward
more complex operations.
We assume you already read
We also assume you have some knowledge of working with text in InCopy and understand basic
typesetting terms.

Entering and importing text

This section covers the process of getting text into your InCopy documents. Just as you can type text into
text frames and place text files using the InCopy user interface, you can create text frames, insert text into
a story, or place text files using scripting.

Stories and text frames

All text in an InCopy layout is part of a story, and every story can contain one or more text frames. If you are
working with a standalone InCopy document, the document contains one story, and InCopy adds text
frames only when necessary to display the text of the story. This also is true for stories exported from
InDesign as InCopy stories (
When you work with an InCopy story within an InDesign document, the document can contain any
number of stories, and you will see the text frames as they were created in the InDesign layout. Unlike
InDesign, InCopy cannot add new text frames using scripting.
For more on understanding the relationships between text objects in an InCopy document, see
objects" on page

Adding text to a story

To add text to a story, use the
text at the end of a story (for the complete script, see AddText):
var myDocument = app.documents.add();
//Add text to the default story.
var myStory = myDocument.stories.item(0);
myStory.contents = "This is the first paragraph of example text.";
//To add more text to the story, we'll use the last insertion point
//in the story. ("\r" is a return character in JavaScript.)
var myInsertionPoint = myStory.insertionPoints.item(-1);
myInsertionPoint.contents = "\rThis is the second paragraph.";
Chapter 2, "Getting Started"
files).
.incx
34.
contents
and know how to create, install, and run a script.
property. The following sample script uses this technique to add
"Text
25

Advertisement

Table of Contents
loading

This manual is also suitable for:

Incopy cs4

Table of Contents