Skip to main content
Participating Frequently
July 18, 2018
Answered

Batch Edit Properties on Existing Comments

  • July 18, 2018
  • 1 reply
  • 3584 views

I made many comments on several pages of a .pdf then realized I should have made them a different color.  Is there a way to batch edit the properties to change all the existing properties instead of having to change them one by one? - Danielle

This topic has been closed for replies.
Correct answer try67

sorry - i do not.  i can work well with instructions though!


No problem. Here's what you need to do.

Press Ctrl+J and a window will appear. It will look something like this:

Click into the text area in the lower half of the window. If it asks you whether to enable the console, click Yes.

Select all the text in that field and delete it. Then paste the following code into the same field:

 

this.syncAnnotScan();

var annots = this.getAnnots();

if (annots!=null) {

    for (var i in annots) {

        var annot = annots[i];

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

            var annotContents = annot.richContents;

            for (var j in annotContents) {

                annotContents[j].textColor = color.green;

            }

            annot.setProps({richContents: annotContents});

        }

    }

}

 

Now the tricky part. Select all of that text using the keyboard (Ctrl+A) or mouse and then press Ctrl+Enter. Use the Enter key next to the number-pad, though, not the big one in the center of the keyboard. If it works the word "undefined" should appear at the bottom of the field, and the comments should be changed to green.
If something else happens, please describe what it was.

 

If it worked you can now select one of these comments using the Object Select Tool (a black cursor), right-click it, go to Properties and then tick the "Make Properties Default" box, and press OK. Any new comments you create afterwards will be green by default, so you won't need to run the script again.

1 reply

try67
Community Expert
Community Expert
July 18, 2018

Yes, that's possible with a script. What kind of comments are they, and what color do you want to change (font color? fill color? border color? etc.), and to what color?

Participating Frequently
July 18, 2018

They are in text format from the typewriter and lines.  I just want to change the font color from red to green.

Participating Frequently
July 18, 2018

OK. Do you know how to use the JS Console?


sorry - i do not.  i can work well with instructions though!