-
ExtendScript: Test if plugin exists
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