Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
They are in text format from the typewriter and lines. I just want to change the font color from red to green.
Copy link to clipboard
Copied
OK. Do you know how to use the JS Console?
Copy link to clipboard
Copied
sorry - i do not. i can work well with instructions though!
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
that did work!!! thank you - now i see in the script you have color.green... so say i wanted to change it to blue i would just type color.blue?
Copy link to clipboard
Copied
or if i needed it a darker green?
Copy link to clipboard
Copied
For blue you can use color.blue, yes.
For more custom colors you can use a generic color array, like this:
["RGB", 0.4, 0, 1]
The three values are R, G, B values, ranging from 0 to 1. So if you have values that range from 0 to 255 then you should divide then by 255 before using them.
Copy link to clipboard
Copied
Thank you! this is awesome! I appreciate it!.

