After Effects Clock Script - How To Make Clock In Adobe After Effects


Making a digital clock in Adobe After Effects is not that difficult and hardworking all you need just the clock script which is going to do the heard work for you. This script should be pasted in the Text source of your text layer, and you are good to go. In this quick tutorial we are going to see how can we make a easy yet powerful clock using script in After Effects. Make sure to stick to the end.




You need to paste this script in the text source of your Text layer, take a look some screenshots and follow the same steps.



1. Create a new text by right clicking on the black area of the timeline, or you can select the text tool and click on the Composition window for creating a new text.







2. Now open text layer, and the add an expression on the Source Text. Please note you have to press and hold the Alt (Windows) or Option (Mac) key on your keyboard to add an expression.





3. Now copy this script below and the paste it in to the expression area.


rate = 1;
clockStart = 0;

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

clockTime = Math.max(clockStart + rate*(time - inPoint),0);

t = Math.floor(clockTime);
min = Math.floor((t%3600)/60);
sec = Math.floor(t%60);
min + ":" + padZero(sec)