Skip to main content
Known Participant
April 7, 2025
Question

How to get textframe fillcolor using extendscript?

  • April 7, 2025
  • 1 reply
  • 349 views

Hi,

 

I need to get text frame fill color for below mentioned scenarios.

 

1) overall textframe fill color is applied.
2) character wise fill color is applied.          

var chars = doc.textFrames[0].textRange.characters;
chars[0].characterAttributes.fillColor;

3) multiple fill color is applied
4) overprint fill color

1 reply

RobOctopus
Inspiring
April 7, 2025

this should help

var thisFrame = app.activeDocument.textFrames[0]
var thisFrame_FrameFill = thisFrame.textPath.fillColor // returns color object of the text path of the area frame
var thisFrame_TextFill = thisFrame.textRange.characterAttributes.fillColor //returns color object of text fill color. if multiple in box. should technically just be the first
var thisFrame_CharacterFill = thisFrame.textRange.characters[3].characterAttributes.fillColor //returns color object of specified character. would have to verify each character if multiple? not sure if easier way
var thisFrame_OverprintFill = thisFrame.textRange.characters[3].characterAttributes.overprintFill //returns true/false if color is overprint
//var thisFrame_OverprintFill = thisFrame.textRange.characterAttributes.overprintFill //returns true/false if color is set to overprint. set all or specific characters either going textRange.Attributes or textRange.Characters[#].Attributes
psar12345Author
Known Participant
April 8, 2025

Hi @RobOctopus ,

 

Overprint Fill is enabled but it returns false only. Please see the below screenshot.

 

thisFrame_FrameFill - [NoColor]
thisFrame_TextFill - [NoColor]
thisFrame_CharacterFill - [NoColor]
thisFrame_OverprintFill - false