How to retrieve Effects of a Layer

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
manohar
Posts: 15
Joined: April 23rd, 2010, 6:58 am

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
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

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");
}
manohar
Posts: 15
Joined: April 23rd, 2010, 6:58 am

hey...!! :D
thank u very much Paul... :) :)
i got it... :idea:
Post Reply