Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects ExtendScript: Test if plugin exists

  • ExtendScript: Test if plugin exists

  • Mike Sevigny

    May 11, 2016 at 9:58 pm

    Hey guys,
    Wondering if there’s a quick way to test for a plugin by name without going through the directories and looking for the actual file.

    I’ve tried cycling through the effects until it finds it by name but it takes a few seconds.
    effectExists = 0;
    for (i = 0; i<=app.effects.length; i++) {
    if (String(app.effects[i].displayName) == "EFFECT_NAME") {
    effectExists = 1;
    break;
    }
    }

    Right now I’ve resorted to programmatically creating a comp, then a solid and ‘trying’ to add the effect to generate my true/false value.. then deleting those elements.
    try{
    tempComp = app.project.items.addComp('tempComp', 40, 20, 1, 1, 1); // Create new Comp
    tempSolid = tempComp.layers.addSolid([1,1,1],'tempSolid', 40, 20,1,1)
    tempSolid.Effects.addProperty("EFFECT_NAME");
    tempSolid.source.remove();
    tempComp.remove();
    effectExists = 1;
    }catch(err){
    effectExists = 0;
    }

    There must be a better way.. I wasn’t able to find anything in the manual. Thanks for the help..

    Mike Sevigny

  • Walter Soyka

    May 12, 2016 at 5:34 pm

    Maybe take advantage of the fact that Ae effects are listed in the Effects menu? Check out this example:

    effectMenuName = "Levels";
    if (app.findMenuCommandId(effectMenuName) == 0) effectExists = false else effectExists = true;
    alert(effectExists);

    Walter Soyka
    Designer & Mad Scientist at Keen Live [link]
    Motion Graphics, Widescreen Events, Presentation Design, and Consulting
    @keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]

  • Mike Sevigny

    May 12, 2016 at 11:41 pm

    That works beautifully..
    Thank you as usual Walter, you’re a machine.

    Mike Sevigny

Viewing 1 - 3 of 3 posts

Log in to reply.

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