Reply To: Paragraph with 3 lines or less indented till after first word

#14323445

It *is* a niche thing, but it’s a small enough request to write a custom script for. This one requires you to click inside the story to process – it does not Play Nice with stuff like locked layers and master pages and such.
It just inserts the Indent To Here marker at the start of the second word in a story. It also processes one-line paragraphs, which is kinda superfluous, but there you go, it was in the specs.

//DESCRIPTION:Indent 3-line paragraphs after first word
// A Jongware Script 15-Dec-2019
// 1. Iterate over all paragraphs.
allParagraphs = app.selection[0].parentStory.paragraphs;
// 2. Filter out 3-lines-or-less.
for (i=0; i<allParagraphs.length; i++)
{
// 3. Indent them after the first word.
if (allParagraphs[i].words.length > 1 && allParagraphs[i].lines.length <= 3)
{
allParagraphs[i].words[1].insertionPoints[0].contents = '\u0007';
}
}

This article was last modified on December 15, 2019

Comments (0)

Loading comments...