Page 1 of 1

How to retrieve Effects of a Layer

Posted: June 17th, 2010, 5:17 am
by manohar
hi..
I want to retrieve all the effects of a layer(If it has any..). How to do that using script..
can anyone help...!! :?

What is the procedure to know that whether a layer has any effects applied to it or not.. I saw isEffect attribute of PropertyBase object in Scripting guide., but don't know how to use that coz whats that propertySpec stands for...?

any help greatly appreciated...
thanx in advance..!! :D

Re: How to retrieve Effects of a Layer

Posted: June 17th, 2010, 12:19 pm
by Paul Tuersley
Here's an quick example that reports how many effects are on the first layer in a selected comp:

Code: Select all

var activeItem = app.project.activeItem;
var theLayer = activeItem.layer(1);
var theEffects = theLayer.Effects;
if (theEffects) { // if not undefined the layer can support effects
	alert("There are " + theEffects.numProperties + " effects on this layer");
} else {
	alert("You can't apply effects to this type of layer");
}

Re: How to retrieve Effects of a Layer

Posted: June 19th, 2010, 2:18 am
by manohar
hey...!! :D
thank u very much Paul... :) :)
i got it... :idea: