Skip to content

Instantly share code, notes, and snippets.

@benwurth
Created September 21, 2013 01:10
Show Gist options
  • Save benwurth/6645983 to your computer and use it in GitHub Desktop.
Save benwurth/6645983 to your computer and use it in GitHub Desktop.
An After Effects script that produces a long line of numbers as Text Layers. All layers are parented to a null object for easy handling.
{
//Begin undo group
app.beginUndoGroup("Long Line of Numbers");
//Variables
var minNumber = 0;
var maxNumber = 0;
function main() {
//Get minNumber
minNumber = parseInt(prompt("What number do you want to start with?", "1975"));
maxNumber = parseInt(prompt("What number do you want to end with?", "1989"));
yearsComp = makeComp(minNumber, maxNumber);
for (i=minNumber; i<=maxNumber; i++) {
currentIteration = i - minNumber;
width = 256 + (currentIteration*1920);
curText = yearsComp.layers.addText(String(i));
var textProp = curText.property("Source Text");
var textDocument = textProp.value;
textDocument.fontSize = 520;
textProp.setValue(textDocument);
curText.property("position").setValue([width, 760]);
}
}
function makeComp(min, max) {
compWidth = (max-min+1)*1920;
return app.project.items.addComp("Years", compWidth, 1080, 1.0, 240.0, 24.0);
}
main();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment