ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

How to find the selected layer index number?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Palak Bhatt
How to find the selected layer index number?
on Jul 23, 2020 at 9:16:04 pm

Does anyone have the idea
How to find the Index number of current or selected layer

How to find the ID or number of my selected layer?

Please help

var i = app.project.item(index).layer(index);


Return to posts index

Filip Vandueren
Re: How to find the selected layer index number?
on Jul 23, 2020 at 9:52:48 pm


if (app.project.activeItem.selectedLayers.length>0) {
var i = app.project.activeItem.selectedLayers[0].index;
}


There can always be more than one layer selected, so selectedLayers is always an Array, it could be an empty error, so first check for the length or it might throw an error



Return to posts index

Palak Bhatt
Re: How to find the selected layer index number?
on Jul 24, 2020 at 8:15:46 am

Love you so much. Thank you
Its worked like a charm.. Very Glad


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]