return absolute leading

Tagged: ,

This topic contains 2 replies, has 2 voices, and was last updated by  Raphael Freeman 5 days, 17 hours ago.

  • Author
  • #92264

    I am writing my very first script (wish my luck) and I’m trying to return the leading of text that I have selected. The problem is that the leading happens to be set to Auto and I want it to return the absolute leading.

    This is what I typed:


    and it gave me AUTO instead of 15. (The leading happens to be 12/Auto but in the character panel it says (15pt)

    Is there a way to return 15?

  • #92265

    Loic Aigon


    Leading can either be a numeric value or an enumeration ( Leading.AUTO ) which you got.

    So you may want to check if leading is set that wey and if so compute the leading based on font size and autoLeading value:

    var sel = app.selection[0];
    var leading = sel.leading;
    leading==Leading.AUTO && leading = sel.pointSize*sel.autoLeading/100;
    alert (“leading is worth:”+leading );



  • #92267

    Thank you very much. I will try that.

You must be logged in to reply to this topic.