Skip to main content
Inspiring
June 3, 2014
Answered

Need help to find the "leading point size"

  • June 3, 2014
  • 1 reply
  • 378 views

Hi,

I need help to find the "leading point size".

Any para style leading is more than 2 points of my font size, I need the alert message "Its more than 2 points for your font size". For instance my para font size is 10 here my leading should be 12 points rather than its 14 points, I need the alert message.

Is this possible by script?

by

hasvi

This topic has been closed for replies.
Correct answer Chinnadk

Hi Hasvi,

Try this.

var doc = app.activeDocument;

var texts = doc.stories.everyItem().textStyleRanges.everyItem().getElements();

var pstyle = "Following paragraph styles have more leadings:\r\r";

for(var i=0;i<texts.length;i++)

{

    var ps = texts.pointSize;

    if(texts.leading > ps + 2)

    {

        pstyle += texts.appliedParagraphStyle.name;

        }

}

alert(pstyle)

If it is correct than mark the answer as correct and don't mark your question as correct answer.

Regards,

Chinna

1 reply

Chinnadk
ChinnadkCorrect answer
Legend
June 3, 2014

Hi Hasvi,

Try this.

var doc = app.activeDocument;

var texts = doc.stories.everyItem().textStyleRanges.everyItem().getElements();

var pstyle = "Following paragraph styles have more leadings:\r\r";

for(var i=0;i<texts.length;i++)

{

    var ps = texts.pointSize;

    if(texts.leading > ps + 2)

    {

        pstyle += texts.appliedParagraphStyle.name;

        }

}

alert(pstyle)

If it is correct than mark the answer as correct and don't mark your question as correct answer.

Regards,

Chinna

hasviAuthor
Inspiring
June 4, 2014

thanks chinna