Skip to main content
Inspiring
January 16, 2023
Answered

cs4 set color of text frame does not work

  • January 16, 2023
  • 1 reply
  • 535 views

I need to set registration color to selection and the following doesn't work

 

 

var colour = app.activeDocument.swatches['[registration]'].color;
selection[0].contents.fillColor = colour;

 

 

using `selection[0].fillColor` doesn't work also

This topic has been closed for replies.
Correct answer femkeblanco

Try

selection[0].textRange.fillColor = color;

 

1 reply

femkeblanco
Legend
January 16, 2023

Is the selection a text frame?

Inspiring
January 16, 2023

yes, it's a text frame

femkeblanco
femkeblancoCorrect answer
Legend
January 16, 2023

Try

selection[0].textRange.fillColor = color;