Page 1 of 1

How can I get this to work?

Posted: February 5th, 2013, 7:25 pm
by scribling
I want the "Repeat Edge Pixels" to be on or checked.

Code: Select all

//1.  Define layer
target = app.project.activeItem.selectedLayers[0];
//2.  Test for AVlayer and apply effect
if (target.nullLayer == 0){
var the_fx = target("Effects").addProperty("Fast Blur");

//Set Value
property(3).setValue(true)
 
 
} else {
alert("this is a null.");
}

Re: How can I get this to work?

Posted: February 6th, 2013, 7:32 am
by Paul Tuersley
You were so close I'm surprised you missed it:

the_fx.property(3).setValue(true);

Re: How can I get this to work?

Posted: February 6th, 2013, 12:48 pm
by scribling
Would it be,
fastblur.property(3).setValue(true)
or
("Fast Blur").property(3).setValue(true)?

Neither work, by the way.

Re: How can I get this to work?

Posted: February 6th, 2013, 12:57 pm
by Paul Tuersley
I wrote the line you needed. In your code you had

Code: Select all

property(3).setValue(true)
but "property" isn't a variable.

You defined the variable when you wrote:

Code: Select all

var the_fx = target("Effects").addProperty("Fast Blur");
So "the_fx" is now a variable that is storing the effect object.
So to access a property of the effect object you write this instead:

Code: Select all

the_fx.property(3).setValue(true);
In other words, your original code was correct except you needed to add

Code: Select all

the_fx.
in front of

Code: Select all

property(3).setValue(true)

Re: How can I get this to work?

Posted: February 6th, 2013, 1:36 pm
by scribling
Ok, great. Yep, works like a charm!

Thanks so much!