-
AE script for Premiere subtitles
Hi,
I found a script online that reads the metadata of an audio file (which was previously analysed by Premiere) and extracts the text from it, placing it into an empty text holder in After Effects at the exact time that the text should be appearing. It displays line-by-line with a maximum of 10 words at a time. It’s a very smart little script and works well.
I’ve contacted the author to ask for help from him, but thought i’d post here too.
I’m looking for a way to modify the script slightly so that when extracting text from the metadata and displaying it on-screen, it detects when there is a full stop (ie. end of the sentence) and then saves it for a new line, when it is time for that to be shown. If no full stop is found, then it continues to display a max. of 10 words to fill the line.
Thanks in advance,
Sean.L = thisComp.layer("posetivity_voice_1.aac");
max = 10; // number of words to display
n = 0
if (L.marker.numKeys > 0){
n = L.marker.nearestKey(time).index;
if (L.marker.key(n).time > time){
n--;
}
}
s = " ";
if (n > 0){
base = Math.floor((n-1)/max)*max + 1;
for (i = base; i < base + max; i++){
if (i <= L.marker.numKeys){
s += L.marker.key(i).comment + " ";
}
}
}
s