Skip to main content
Known Participant
May 11, 2017
Question

Action to change color (Black to DK Red) and from Regular to BOLD ??

  • May 11, 2017
  • 1 reply
  • 384 views

Hi folks,

There are documents we annotate after receiving from our campuses where we typically manually change the Text Font Color from our default (black) to Dark Red, and also from regular to Bold faced.

Does anyone know how to set up an "action"  (or macro equivalent) to automate this task... as well as the reverse ?

Please advise when you get a moment.

Many thanks & till later,

Rick Stockstill

North East Independent School District

San Antonio, TX

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
May 12, 2017

Just to be clear, are you referring to the FreeText commenting tool, or are you adding text in another way?

Known Participant
May 12, 2017

Hi again,

FreeText commenting tool... represented by the little rectangular icon with the letter  "T" in the middle of same.

There are specific documents that require the Dark Red font, so I am always changing from the Default of Black to the Dark Red...no big deal if done once/day or so... but this happens numerous times each day.  In Excel, I'd simply record a macro and execute with something like CTRL+J... and am looking for an equivalent capability for Adobe Acrobat Pro.

Much appreciated & till later,

Rick S.

try67
Community Expert
Community Expert
May 12, 2017

This code will convert all of the texts in these comments to a dark red (you can play around with the exact RGB value, if you wish) and make them bold:

this.syncAnnotScan();

var annots = this.getAnnots();

if (annots!=null && annots.length!=0) {

    for (var i in annots) {

        var a = annots;

        if (a.type=="FreeText") {

            var spans = a.richContents;

            for (var j in spans) {

                spans.textColor = ["RGB", 0.8, 0, 0];

                spans.fontWeight = 700;

            }

            a.richContents = spans;

        }

    }

}

You can execute this code from the JS-Console, or even from a menu button that is added to the application, but that would require adjusting it a bit and putting it in a script file that's installed in a local folder.