Hi Dan,
I’m amazed by this script, I’ve been looking for something like this for a long time. I’m using the code to create dynamic underlines that change automatically with the width of the text. I’m parenting one null object to the position of the left aligned text and using your code to parent another null object to the ragged right side of the text. I’m then using the connect layers plugin to create a stroke that connects the two null objects (thus creating the underline). It seems to be the perfect way to solve my need for dynamic underlines, but the one issue I’m having is once I’ve pasted your script it becomes very taxing on my CPU and doesn’t end up helping me save the time I was hoping to save. My laptop is not very beefy, but I’m baffled because the script seems pretty simple and I feel like I’ve used much more complicated scripts without this kind of lag. Any suggestions?
MacBook Pro (Retina, 15-inch, Late 2013)
2.3 GHz Intel Core i7
16 GB 1600 MHz DDR3
NVIDIA GeForce GT 750M 2048 MB
Intel Iris Pro 1536 MB
L = thisComp.layer("My name is Jonas.");
for (i = thisComp.width; i >= 0; i--){
temp = L.sampleImage([i,thisComp.height/2],[0.5,thisComp.height/2],true,time);
if (temp[3] > 0) break;
}
[i,value[1]]