ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

ExtendScript: Test if plugin exists

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Mike SevignyExtendScript: Test if plugin exists
by on May 11, 2016 at 9:58:39 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;

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.
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)
effectExists = 1;
effectExists = 0;

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

Mike Sevigny

Return to posts index

Walter SoykaRe: ExtendScript: Test if plugin exists
by on May 12, 2016 at 5:34:15 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;

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

Return to posts index

Mike SevignyRe: ExtendScript: Test if plugin exists
by on May 12, 2016 at 11:41:28 pm

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

Mike Sevigny

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 All Rights Reserved