Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions reverse layer order in whole project

  • reverse layer order in whole project

    Posted by Lars Pedersen on December 13, 2013 at 4:08 pm

    hi!

    Is there a way to script an script that can reverse layer order in all selected comp’s?? Found a script that does it on aescripts.com but that requires to select the layers and press a button and i have 60+ comps that needs it fixed.

    Thanks.

    James Retling replied 11 years, 7 months ago 3 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    December 13, 2013 at 6:20 pm

    Something like this should work:


    var myItems = app.project.selection;
    var myComp;
    for (var i = 0; i < myItems.length; i++){ if (myItems[i] instanceof CompItem){ myComp = myItems[i]; for (var j = myComp.numLayers -1 ; j > 0; j--){
    myComp.layer(j).locked = false;
    myComp.layer(j).moveToEnd();
    }
    }
    }

    Dan

  • Lars Pedersen

    December 13, 2013 at 6:52 pm

    thanks Dan 🙂 You’re a legend and just save my day. I gave you a small tip in the tip jar @https://www.motionscript.com

  • James Retling

    September 24, 2014 at 9:21 pm

    Found this on another creative cow answer.

    Click the layer you want to be the first layer, shift click the layer you want to be the last layer, then cut (ctrl/cmd+x) and paste (ctrl/cmd+v). Voila!

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