Last active
September 29, 2020 19:15
-
-
Save wormeyman/8010246 to your computer and use it in GitHub Desktop.
After Effects Countdown Timer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rrtrt