I'm writing an expression to control the sourceText of a text layer based upon the length of another text layer. Part of the functionality is to only update the current layer text if there is a large enough change in length. Is there a way to access the current value of the text layer that was generated by the expression? value and sourceText.text point to the text set on the text layer, not the generated layer.
Here's my expression
function calc(prevValue) { var textLength = thisComp.layer(1).text.sourceText.length; var perc = thisComp.layer(2).text.animator("Animator 1").selector("Range Selector 1").start; var newValue = 140 - Math.floor(textLength * perc / 100); return (parseInt(prevValue) - newValue) < 10 ? prevValue : newValue; } //Need to pass the previously generated text value here...how do you access it? calc(text.sourceText);
Couldn't find any way to access it in the expression references.
Thoughts?
Calvin