Skip to main content
Participant
June 21, 2016
Answered

Access / Change Fill Effect Color from ExtendScript

  • June 21, 2016
  • 2 replies
  • 4871 views

Hey all,

This may be a pretty simple answer but I'm new to scripting, and I have a layer with the effect "Fill" and I would like to change the color value in my script.  Am I not accessing the effect correctly or I am putting in the wrong value?

app.project.item("Controls").layers("Colors").effect("Fill")(3) == '#ffffff';

So the comp is called "Controls", it has a solid inside it called "Colors" and the effect is "Fill".  I am trying to change it to white.

Thanks in advance!

This topic has been closed for replies.
Correct answer tardigrade01

as far as I know, you always have to convert your hex values to rgb for extendScript.

where layer(1) is your solid and [1,1,1] is any RGB value (0-1 range) you want  --

app.project.activeItem.layer(1).property('Contents').property(3).property('Color').setValue([1,1,1]);

2 replies

Participant
June 24, 2016

Cool, the RGB and the 'setValue' were the things I needed!  Thanks!

tardigrade01
tardigrade01Correct answer
Inspiring
June 24, 2016

as far as I know, you always have to convert your hex values to rgb for extendScript.

where layer(1) is your solid and [1,1,1] is any RGB value (0-1 range) you want  --

app.project.activeItem.layer(1).property('Contents').property(3).property('Color').setValue([1,1,1]);