Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Add Comps to Another Comp in ExtendScript

  • Add Comps to Another Comp in ExtendScript

    Posted by Nate Hanson on June 18, 2013 at 12:02 am

    My script is creating new comps in a loop. As they are created, I’d like to add them to an existing comp called previewComp. How can I do this?

    Thanks in advance for your help,

    var theComp = app.project.activeItem;
    var previewComp = app.project.items.addComp("Preview Comp", 1280, 720, 1, 120, 23.976);

    for(i = 0; i < 10; i++)
    {
    theComp.duplicate();
    // Add the newly created comp to another comp called previewComp
    }

    Nate Hanson
    Pilothouse Films

    Nate Hanson replied 12 years, 11 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    June 18, 2013 at 12:27 am

    I haven’t tested this, but I think it would be:

    var newComp = theComp.duplicate();
    previewComp.layers.add(newComp);

    Dan

  • Nate Hanson

    June 18, 2013 at 12:33 am

    Thanks, Dan! That worked.

    I was close…for some reason I had addComp stuck in my mind instead of just add.

    Nate Hanson
    Pilothouse Films

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