-
Change text.layer duration base on word
Hi,
I’m looking for a expression or probably in this case a script that can automatically adapt the duration of a text layer base on the number of word.
I saw an old post close to that idea but change the duration of the comp layer and not the text layer.
var myComp = app.project.activeItem;
var myLayer;
var numWords = 0;for (var i = 1; i <= myComp.numLayers; i++){
myLayer = myComp.layer(i);
if (myLayer instanceof TextLayer){
numWords += myLayer.property(“Text”).property(“Source Text”).value.toString().split(” “).length;
}
}
myComp.duration = 2 + Math.floor(numWords/3);This script was write by Dan Ebberts (creative cow forum hero) in this post : https://forums.creativecow.net/thread/227/28672
So let say that I have a comp with multiple text layer, with different number of word, I would like to be able to select the text layer and apply the script or the expression to change the duration of the layer base on 3 word a second and also put 2 sec because I have a text animation and it stop 2 sec before the end of the text layer duration.
Looking for this kind of formula Text.layer Total Duration = (3 words/sec.)+2 sec.
Hope someone can help me.
Thank you !
Sorry, there were no replies found.