Answered
rob dayCorrect answer
Community Expert
Jul 11, 2025 6:47 PM UTC
mytextFrame = app.selection[0];
if (mytextFrame.constructor.name == "TextFrame")
if (mytextFrame.overflows)
{
......
}If if (mytextFrame. overflow) is true, how to expand mytextFrame down 3-5 lines (or increase the height of the text box by 5mm)
You can use the textFrame’s fit() method on the selected text frames that have overflows:
var s = app.documents[0].selection;
for (var i = 0; i < s.length; i++){
//get the text frames that overflow
if (s[i].constructor.name == "TextFrame" && s[i].overflows) {
s[i].fit(FitOptions.FRAME_TO_CONTENT)
}
};



