Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions comp seletion and layers

  • comp seletion and layers

    Posted by Roby Kiss on December 11, 2011 at 12:02 am

    i need a script when i select some comps to change the first layer in every comp with a footage for example.
    I never used scripts….

    var theComps = selectedComps;
    for (i = 1; i<= theComps.length; i++) {

    // from here i`m lost :))

    }

    Roby Kiss replied 14 years, 5 months ago 1 Member · 1 Reply
  • 1 Reply
  • Roby Kiss

    December 11, 2011 at 11:14 am

    ae scripting tutorials are smashed up but i finally managed something:

    var selectedComps = new Array();

    if (app.project != null)
    {
    var selectedItems = app.project.selection;

    for (var i = 0; i < selectedItems.length; i++)
    {
    projItem = selectedItems[i];
    if (projItem instanceof CompItem)
    selectedComps[selectedComps.length] = projItem;
    }
    }
    var myLayer = selectedComps[0].layer(5) ;
    // for layer 5 i have the path: [File] /e/Picture1.gif
    how can I replace it with: /e/Picture2.gif ?

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