Question
After Effect Expression error (Expected: ;)
Hey, I am currently coding an after effect expression but I get an error at the line 5 . It says ''Expected: ;'' but I checked everything and made no mistake.
This expression is put directly on the source text property of a text layer.
My code allows to decompose a srt syntax, and to have the live text synchronized on a single text layer.
My code :
text_srt = thisComp.layer("1 00:00:00,500 --> 00:00:02,999 Les codes de couleur du sous-titrage pour les sourds et les malentendants. 2 00:00:03,001 --> 00:00:05,999 Le magenta pour les indications musicales. 3 00:00:06,001 --> 00:00:08,999 Le vert pour les indications ou retranscriptions de langues étrangères.").text.sourceText;
text_separer = text_srt.split('\r');
srtText = text_separer ;
for (let i = 0; i < text_separer.length; i++) {
srtTime = srtText[1].split(" --> ");
startTimeSrt = srtTime[0];
endTimeSrt = srtTime[1];
subtitleText = srtText.slice(2);
subtitleTime = {
start: startTimeSrt,
end: endTimeSrt
};
subtitle = {
time: subtitleTime,
text: subtitleText[0]
};
k = 0;
while (k == 0) {
if (srtText[0] == '') {
srtText.shift();
k = 1;
} else {
srtText.shift();
}
}
}
