Skip to main content
Participant
February 9, 2016
Answered

Reading properties on textframes

  • February 9, 2016
  • 3 replies
  • 552 views

Hi

I need to be able to get the background color and background image of a textframe using scripting. I can't find anything in documentation about this. Suggestions?

Also, I need to test if one or more textframes are linked together. Suggetions?

Thanks in advance

Bo Dudek

Webdeveloper

Mediegruppen

This topic has been closed for replies.
Correct answer Peter Kahrel

To test if a text frame is linked to another one, use nextTextFrame and/or previousTextFrame:

if (myFrame.nextTextFrame === null && myFrame.previousTextFrame === null) {

  // the frame is not linked to another frame

}

Background colour: myFrame.fillColor

Background image of a text frame: is that an image behind a text frame?

3 replies

Bo DudekAuthor
Participant
February 10, 2016

@pkahrel

Thanks - no need for images, only colour, so your answer is, what I was looking for.

@Loic.Aigon

Nope, not needed at all. Thanks anyway.

I actually did forget something: I also need to vector graphics are inserted into the textframes, as our graphic department in most cases create a textframe and then inject a small piece of vector art inside like a speechbubble or equal. Suggestions here?

Thanks in advance

Bo Dudek

Webdeveloper

Mediegruppen

Peter Kahrel
Community Expert
Community Expert
February 10, 2016

> vector graphics are inserted into the textframes

myFrame.rectangles

Loic.Aigon
Legend
February 9, 2016

Hi Bo,

Is it possible you want to get background fill or image to analyze contrast and text readibility ?

In this case, there isn't such feature that I know of.

Loic

Peter Kahrel
Community Expert
Peter KahrelCommunity ExpertCorrect answer
Community Expert
February 9, 2016

To test if a text frame is linked to another one, use nextTextFrame and/or previousTextFrame:

if (myFrame.nextTextFrame === null && myFrame.previousTextFrame === null) {

  // the frame is not linked to another frame

}

Background colour: myFrame.fillColor

Background image of a text frame: is that an image behind a text frame?