Skip to main content
This topic has been closed for replies.

2 replies

CarlosCanto
Community Expert
Community Expert
November 28, 2018

check this script by TenA

text overflow + postFix

Inspiring
December 1, 2018

Thanks Silly-v and CarlosCanto

if there is empty lines in the textframe then the above script did not worked..

because paragraphs.characters returns error for empty/new lines

Silly-V
Legend
November 28, 2018

This is still a work in progress for myself, but you can check to see if the contents of lines of a text frame all match up with the total text contents of the text frame.

I think my function for the single-line overset has been proved to work most of the time - check it out:

  function isOverset(textBox, lineAmt) {

    if (textBox.lines.length > 0) {

      var charactersOnVisibleLines = 0;

      if(typeof(lineAmt) != "undefined"){

        lineAmt = 1;

      }

      for (var i = 0; i < lineAmt; i++) {

        charactersOnVisibleLines += textBox.lines.characters.length;

      }

      if (charactersOnVisibleLines < textBox.characters.length) {

        return true;

      } else {

        return false;

      }

    } else if (textBox.characters.length > 0) {

      return true;

    }

  };