How can I get this to work?

What type of scripts do you need?

Moderator: byronnash

Post Reply
scribling
Posts: 143
Joined: May 1st, 2005, 1:52 pm

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

You were so close I'm surprised you missed it:

the_fx.property(3).setValue(true);
scribling
Posts: 143
Joined: May 1st, 2005, 1:52 pm

Would it be,
fastblur.property(3).setValue(true)
or
("Fast Blur").property(3).setValue(true)?

Neither work, by the way.
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

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)
scribling
Posts: 143
Joined: May 1st, 2005, 1:52 pm

Ok, great. Yep, works like a charm!

Thanks so much!
Post Reply