• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to colorize AFrames

New Here ,
Oct 29, 2017 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

345

Translate

Translate

Report

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

correct answers 1 Correct answer

Enthusiast , Oct 30, 2017 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.

Votes

Translate

Translate
Enthusiast ,
Oct 30, 2017 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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

Hi Klaus,

Thank you very much for your quick answer.

I will reread references to understand objects in FrameMaker more.

Best regards,

Votes

Translate

Translate

Report

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