-
If last line empty – use previouse one
Hey guys. I need some help figuring out how write it.
I have a bullet list with 9 lines of text.
What i am trying to write is an expression to find last line which is empty based on .height and use previous that is not empty.I have an expression to determine the longest line.
var out_width = 0;
for (i = 1; i <= 9; i++) { var elem = comp("T01 Text 0" + i).layer(1); var w = elem.sourceRectAtTime(2).width; if (out_width < w) out_width = w; } Found out similar question here https://stackoverflow.com/questions/33268863/find-last-matching-object-in-array-of-objectsBut can’t figure out how to rework one i have to fit what i need.
Text lines naming goes like T01 Text 01, T01 Text 02 etc.
Can’t use number of the layer, cause between lines of text can be other objects.Thank you.