Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects AE Scripting : Removing a specific effect by matchName

  • AE Scripting : Removing a specific effect by matchName

    Posted by Rigel Elizaga on August 20, 2021 at 9:44 pm

    Hey there!
    I’m trying to write a code where I can erase a specific Pseudo Effect using matchNames,
    I know I need to define :

    thisEffect

    but how?

    Here’s my trial :

    {
    var comp = app.project.activeItem;
    var getEffects;
    for (var i = 1; i <= comp.numLayers; i++){
    getEffects= myComp.layer(i).Effects;
    for (j = getEffects.numProperties; j > 0; j--){
    if(thisEffect.matchName == "Pseudo/matchName") {
    getEffects.property(j).remove();
    }
    }
    }
    }

    It says “thisEffect” is undefined.

    Walter Soyka replied 4 years, 8 months ago 2 Members · 1 Reply
  • 1 Reply
  • Walter Soyka

    August 24, 2021 at 9:01 pm

    In that code snippet, you never define myComp (should just be ‘comp’) or thisEffect (should reference something from ‘getEffects’) , so Ae doesn’t know what to do.

    This code should work — let me know if you have any questions!

    {

    var comp = app.project.activeItem;

    var getEffects;

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

    getEffects = comp.layer(i).Effects;

    for (var j = getEffects.numProperties; j > 0; j--) {

    if (getEffects.property(j).matchName == "Pseudo/matchName") {

    getEffects.property(j).remove();

    }

    }

    }

    }

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