Skip to main content
dublove
Legend
Oct 29, 2026 4:55 AM UTC
Question

How to obtain the actual value of the leading "AUTO" for the paragraph without applying paragraph styles?

 

 

Hello every

When the paragraph style is not applied, the following two sentences (Leading) return "AUTO", but I want to know the actual value. How to modify.
It seems that when applying the [Basic Paragraph] style, Leading also returns AUTO.

var item = app.selection[0];
var curFirLeading = item.textColumns[0].lines[0].leading;
var curStyLeading = item.lines[0].appliedParagraphStyle.leading;
alert(curFirLeading);
alert(curStyLeading);

I found a complicated method online to obtain the magnification of auto relative to the font size and calculate the Auto value in reverse.

 

    1 reply

    Community Expert
    Oct 29, 2026 5:37 AM UTC

    Auto leading is 120% or the font size. But this is configurable. Try the following code

    var curFirLeading = item.textColumns[0].lines[0].leading;
    var curStyLeading = item.lines[0].appliedParagraphStyle.leading;
    var fontSize = item.lines[0].characters[0].pointSize;
    var autoLeadingPercent = item.textColumns[0].lines[0].autoLeading;
    var actualLeading;
    if (curFirLeading == Leading.AUTO)
    actualLeading = fontSize * autoLeadingPercent / 100;
    else
    actualLeading = curFirLeading;

    alert("Font size: " + fontSize + " pt");
    alert("Auto leading: " + autoLeadingPercent + "%");
    alert("Effective leading: " + actualLeading + " pt");

     

    Translate
    -Manan