hi Paul,
the Point Control can be omitted, the expression there could have been added directly to he position of the Null. But in that case all of the implied/omitted thisLayer.s of the expression’s properties need to be spelled out as a property of the textLyaer, and I found it more convenient to have the “leading edge position” of the text to be a property on the text layer itself.
When applied directly to the Null, it would become:
txtL = thisComp.layer("txt");
i = txtL.text.animator("Animate On (opacity)").selector("Range Selector 1").start.value;
// length of sourcetext excluding linebreaks and softbreaks;
l = txtL.text.sourceText.replace(/\n|\r|\3/g,"").length;
if (txtL.text.animator("Animate On (opacity)").selector("Range Selector 1").advanced.units.value==1) {
// convert from percentage to index
i = i*l/100;
}
i=Math.round(i);
if (i==l) i--; // never exceed the last character !
sr = txtL.sourceRectAtTime(-100-i);
txtL.toComp([sr.left, sr.top+sr.height/2]);
But I’d keep it on the textLayer personally.
Conceivably, you could even have the cursor jump from the end of 1 completed text-layer to the start of the next by adding some code in the Null to interpolate between different pointControls on different textlayers.
But you’re very correct in noting that a point control on a text layer (as on all continuosly rasterized layers) is always in Comp space.