In another last bookmark-related tip we showed you how to change the properties for bookmarks one by one. This can be somewhat impractical when you have hundreds or thousands of bookmarks.
Type a name for the script (anything you can remember) in the script name text area.
Click 'Add', then Click 'Edit'
function ChangeBookmarkColors(bm, nLevel)
// !!!!! Change 3: Add Conditional Options under this line
var s = "";
for (var i = 0; i < nLevel; i++)
s += " ";
// !!!!! Change 1: This line here with other options.
bm.color = ["RGB",0,0,1];
if (bm.children != null)
for (var i = 0; i < bm.children.length; i++)
ChangeBookmarkColors(bm.children[i], nLevel + 1);
// Start the Program
// !!!!! Change 2: this.bookmarkRoot to alternative
You should find all of you bookmarks have been colored blue. (["RGB",0,0,1]).
Instead of just changing the color, try replacing (or adding to) the line indicated with the exclamation marks:
To Set Styles:
bm.style = bkmrkStyle;
Where bkmrkStyle is one of the following values:
0 = Plain,
1 = Italic,
2 = Bold and
3 = Bold&Italic
For example to get a blue, bold&italic bookmark:
bm.style = 3;
bm.color = ["RGB",0,0,1]
Use a differerent Color Model ("CYMK", "G")
Instead of using the Red, Green and Blue color model we can use the Cyan, Magenta, Yellow and Black color model
bm.color = ["CYMK",0,1,1,0]
Start at a Different Bookmark
If you don't want to apply your style changes to all of the bookmarks, then change the 'this.bookmarkRoot' at the line indicated (Change 2) to one of the following:
this.bookmarkRoot.children.children[xxx]; where xxx is the bookmark index number in the tree (see console output for the index number in  square brackets. Example:
The above line would change the second bookmark (the first bookmark is index 0, not index 1) and all of it's children (if it had any).
Use a Condition
At Change postion 3, use a condition to test if the bookmark should be styled or not, for example check the name of the bookmark or check if it has any child bookmarks:
if(bm.name.indexOf("Acrobat") == -1) return;
Copyright Dave Wraight & Planet PDF.
No unauthorised reproduction, distribution or publication permitted.
OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.