Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

After Effects Expression Error

Community Beginner ,
Sep 24, 2020 Sep 24, 2020

rateOfSpeed=1;
clockStartTime = thisComp.layer("TImer Duration").effect("Slider Control")("Slider")*3600;
ClockTimeNumber = Math.floor(clockStartTime-rateOfSpeed*time);

function addZero(n){
if(n<10) {return "0" + n}else{return n};
}

minutes = Math.floor(clockTimeNumber/60);
seconds = clockTimeNumber%60;

if (clockStartTime > 0 && time < clockStartTime) {
addZero(minutes) + “:” + addZero(seconds);
}
else
{“00:00”}

 

 

This is the code, I copied it from a video. And then customize it according to my need. But I am getting error in the following line of code "Syntax Error" reference code: addZero(minutes) + “:” + addZero(seconds);

TOPICS
Error or problem , Expressions , FAQ , Resources , Scripting
899
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Community Expert , Sep 24, 2020 Sep 24, 2020

Change the curly quotes around the colon to straight quotes.

 

Dan

Translate
Advocate , Sep 24, 2020 Sep 24, 2020

What @Dan_Ebbers said - you have Rich Text quotes, and they need to be converted to regular quotes, singe or double.

if (clockStartTime > 0 && time < clockStartTime) {
	addZero(minutes) + ": " + addZero(seconds);
} else {
	"00: 00";
}
Translate
Community Expert ,
Sep 24, 2020 Sep 24, 2020

Change the curly quotes around the colon to straight quotes.

 

Dan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Sep 24, 2020 Sep 24, 2020
LATEST

What @Dan_Ebbers said - you have Rich Text quotes, and they need to be converted to regular quotes, singe or double.

if (clockStartTime > 0 && time < clockStartTime) {
	addZero(minutes) + ": " + addZero(seconds);
} else {
	"00: 00";
}
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines