Skip to main content
selvam214
Inspiring
March 15, 2016
Question

Increase count the paragraph

  • March 15, 2016
  • 1 reply
  • 441 views

Hi,

Could you please help to complete my code.

Here is my workflow:

1. Choose chapter one text

2. Select next and next paragraphs from my selection point

3. Word count length up to 2500, select up to that paragraphs and copy.

var mydoc = app.activeDocument;

var myFirstChap = mydoc.selection[0].paragraphs[0];

alert(myFirstChap.contents); // how to increase the paragraphs count?

My selection point here:

This topic has been closed for replies.

1 reply

tpk1982
Legend
March 15, 2016
selvam214
selvam214Author
Inspiring
March 16, 2016

Hi Karthi,

Thanks for this, i'll check and get back if need any help on this topic.

Selva

selvam214
selvam214Author
Inspiring
March 16, 2016

Hi,

I tried this method, I can't select one or more paragraphs. Kindly guide to me.

var mydoc = app.activeDocument;

var myFirstChap = mydoc.selection[0].paragraphs[0];

mydoc.selection[0].paragraphs[0].select();

var wordlen = 0;

while (wordlen < 2500)

{

    app.select(app.selection[0].parentStory.characters[app.selection[0].paragraphs[-1].characters[-1].index + 1].paragraphs[0]);

    wordlen = app.selection[0].words.length;

}

Selva