Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Creating layers with sequential numbers

  • Creating layers with sequential numbers

    Posted by Evan Schafer on June 11, 2008 at 5:41 pm

    Is there an expression out there that could create a new layer with the number “1”, create a new layer with “2” etc…up to 350? I need to generate these numbers for use in Photoshop eventually so I would save as a PSD, but I cannot figure out how to do it in PS. I’m using CS3, by the way. Thanks!

    Jon Date replied 15 years, 5 months ago 3 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    June 11, 2008 at 6:38 pm

    With an expression, you could just create a text layer, add this expression to the source text:

    index

    And duplicate the layer 349 times.

    Or, create a comp and run a script like this:

    var n = 350; // number of layers to create

    var myComp = app.project.activeItem;
    var myTextLayer;

    for (var i = 350; i > 0; i–){
    myTextLayer = myComp.layers.addText(i);
    }

    Dan

  • Jon Date

    December 6, 2010 at 4:51 pm

    Dan could you help me with a script that does the duplication of the selected Comp in your projects panel.
    I need to duplicate a comp 300+ times and have a comp “1”. I need comp “2”, “3”, “4” etc all the way to 300+ but am struggling to get the correct statements to get it done in the same way you wrote the Layers script above.

  • Dan Ebberts

    December 6, 2010 at 5:45 pm

    Like this:


    {
    var myComp = app.project.activeItem;
    var myNewComp;
    for (var i = 1; i <= 300; i++){
    myNewComp = myComp.duplicate();
    myNewComp.name = "" + (i+1);
    }
    }

    Dan

  • Jon Date

    December 6, 2010 at 5:50 pm

    Thanks Dan!!
    🙂

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy