How to colorize AFrames

New Here ,
Oct 29, 2017

Copy link to clipboard

Copied

Hi,

I am trying the automatic processing below.

  • Add borders to Aframes
  • Colorize Aframes

Before:

before.jpeg

After:

after.jpeg

Adding borders succeeded, but I can't add colors to AFrames.

My script is below.

var doc = app.ActiveDoc;

if (doc.ObjectValid() == true) {

  var colorFormat = doc.GetNamedObject(Constants.FO_Color, "Red");

  var colorProps = colorFormat.GetProps();

 

  var flow = doc.MainFlowInDoc;

  var textFrame = flow.FirstTextFrameInFlow;

  while (textFrame.ObjectValid()) {

    var aFrame = textFrame.FirstAFrame;

    while (aFrame.ObjectValid()) {

      aFrame.Pen = 0;  //=> works!

     

      aFrame.Color.SetProps(colorProps); //=> doesn't work...

      aFrame.SetProps(colorProps); //=> doesn't work...

      aFrame.Color.Name = "Red";  //=> doesn't work...

      aFrame = aFrame.NextAFrame;

    }

    textFrame = textFrame.NextTextFrameInFlow;

  }

}

Please teach me how to handle it.

Thanks,

Koji Koike

TOPICS
Scripting

Views

248

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

1 Correct Answer

Enthusiast , Oct 30, 2017
Klaus Göbel Enthusiast , Oct 30, 2017
Hi Koji,just try this:aFrame.Color = colorFormat;a.Frame.Color is a colorobject. So you have to assign a colorobject also.

Likes

Translate

Translate
Jump to answer Jump to answer
Enthusiast ,
Oct 30, 2017

Copy link to clipboard

Copied

Hi Koji,

just try this:

aFrame.Color = colorFormat;

a.Frame.Color is a colorobject. So you have to assign a colorobject also.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
KeKeJ AUTHOR LATEST
New Here ,
Oct 30, 2017

Copy link to clipboard

Copied

Hi Klaus,

Thank you very much for your quick answer.

I will reread references to understand objects in FrameMaker more.

Best regards,

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more