Skip to content

Instantly share code, notes, and snippets.

@wormeyman
Last active September 29, 2020 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wormeyman/8010246 to your computer and use it in GitHub Desktop.
Save wormeyman/8010246 to your computer and use it in GitHub Desktop.
After Effects Countdown Timer
// Created by steven mitchell
// http://www.icthusproductions.com
// 07FEB2009
// Countdown timer for After Effects, displays timer in Minutes and seconds instead of frames.
// Place in C:\Program Files\Adobe\Adobe After Effects [version]\Support Files\Scripts
// if you wish it to show up in script menu.
var vMin = prompt("How many Minutes", "5");
var vString;
var myProj = app.project;
var myComp = myProj.activeItem;
var selectedLayers = myComp.selectedLayers;
// Start the work!
vString = 'offset = 0; '
+ 'i = inPoint + offset; '
+ 'dur = ' + vMin + '; '
+ 'dur *= 60; '
+ 'seconds = Math.max(dur - Math.max((time - i), 0),0); '
+ 'minutes = Math.floor(seconds / 60); '
+ 'seconds = Math.floor(seconds - (minutes * 60)); '
+ "if(seconds < 10) seconds = '0' + seconds; "
+ "minutes + ':' + seconds "
var myTextDocument = new TextDocument(vString);
var myTextLayer = myComp.layers.addText("Countdown Timer");
app.project.activeItem.layer(1).text.sourceText.expression = vString;
@olggg
Copy link

olggg commented Jun 1, 2016

rrtrt

@dallashallam
Copy link

this is great! thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment