Working with Text

With the relevant knowledge of InDesign’s object model, some idea about properties, and enough knowledge of JavaScript, we should now set about doing something useful with InDesign’s objects and their properties. We’ll begin with some aspects of text processing.

Adding, Replacing, and Removing Text

To add text to, let’s say, a paragraph, place the cursor anywhere in a paragraph in an InDesign document. Remember that each text object has insertion points. If you position the cursor at the very beginning of the paragraph, you in effect select the paragraph’s first insertion point, which in JavaScript ...

Get Scripting InDesign CS3/4 with JavaScript now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.