Reply To: Change character preference settings for all documents in a book

Home Page / Forums / General InDesign Topics (CLOSED) / Change character preference settings for all documents in a book / Reply To: Change character preference settings for all documents in a book

#51557

(Awakes.) Wot? Wot? A script? This javascript ought to work (note: untested!). Copy, save as “CopySupPrefs.jsx” into your scripting folder. Open your book file; then create a new text document and set the preferences as you want them. Run the script to copy these to all documents in the Book. Be aware that — if it works — your text may re-format, because you are changing sizes.

supPos = app.activeDocument.textPreferences.superscriptPosition;
supSiz = app.activeDocument.textPreferences.superscriptSize;

infPos = app.activeDocument.textPreferences.subscriptPosition;
infSiz = app.activeDocument.textPreferences.subscriptSize;

book = app.activeBook;

for (var i=0; i<book.bookContents.length; i++)
{
 var currentDoc = app.open (book.bookContents[i].fullName, false);
 currentDoc.textPreferences.superscriptPosition = supPos;
 currentDoc.textPreferences.superscriptSize    = supSiz;
 currentDoc.textPreferences.subscriptPosition   = infPos;
 currentDoc.textPreferences.subscriptSize    = infSiz;
 currentDoc.close(SaveOptions.YES);
}

This article was last modified on January 20, 2010

Comments (0)

Loading comments...