Activity › Forums › Adobe After Effects Expressions › Script – Select the layer above the currently selected layer
-
Script – Select the layer above the currently selected layer
Posted by Kevin Snyder on December 20, 2021 at 3:55 amIs it possible to select the layer above the currently selected layer with a script? Thanks.
Kevin Snyder replied 1 year, 11 months ago 3 Members · 4 Replies -
4 Replies
-
Fabrice Leconte
December 20, 2021 at 6:02 amSomething 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 pmThank 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 pmJust 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 pmThank you. I tried a variation of that but didn’t have it quite right. I appreciate your help.
Reply to this Discussion! Login or Sign Up