Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Finding specific effect name in each layer

  • Finding specific effect name in each layer

    Posted by Ilya Sire on October 24, 2021 at 12:01 pm

    Hi forum,

    i tried this code to loop each layer to find specific effect name, and i got effects() out of range, is there something did i missed?

    for (i = 1; i <= thisComp.numLayers; i++){
    var curFX = thisComp.layer(i).effect(1);
    if(curFX.name == "somefx"){
    thisComp.layer(i).index
    break
    }
    }
    Ilya Sire replied 4 years, 6 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    October 24, 2021 at 12:49 pm

    Try it this way:

    idx = 0;

    for (i = 1; i <= thisComp.numLayers; i++){

    if (thisComp.layer(i)("Effects").numProperties > 0){

    curFX = thisComp.layer(i).effect(1);

    if(curFX.name == "somefx"){

    idx = i;

    break;

    }

    }

    }

    idx

  • Ilya Sire

    October 25, 2021 at 5:41 am

    Thank you! it worked 🙂

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