Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Script – Select the layer above the currently selected layer

  • Fabrice Leconte

    December 20, 2021 at 6:02 am

    Something like this?

    proj = app.project;
    thisComp = proj.activeItem;
    
    thisComp.layer(thisComp.selectedLayers[0].index-1).selected = true;
  • Kevin Snyder

    December 20, 2021 at 6:30 pm

    Thank you. I appreciate it. Is there a way to make the layer above the only selected layer? Right now I get the original layer and the layer above selected at the same time.

  • Andrei Popa

    December 20, 2021 at 7:54 pm

    Just deselect the layer after selecting the other one, like this:

    proj = app.project;
    thisComp = proj.activeItem;
    thisComp.layer(thisComp.selectedLayers[0].index-1).selected = true;
    thisComp.selectedLayers[0].selected = false;

  • Kevin Snyder

    December 20, 2021 at 8:11 pm

    Thank you. I tried a variation of that but didn’t have it quite right. I appreciate your help.

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