Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Bookmark

Requires Revu 21.5 or above

Bookmark is an object that represents a bookmark in the Bookmarks Tab in Revu. See doc.bookmarkRoot to access the root bookmark node.

properties

children

SecureTypeAccess
NoarrayR

Returns an array of Bookmark objects representing the children of the bookmark. If there are no children, null is returned.

example:

function PrintBookmark(bookmark, indent) {
    console.println(indent + bookmark.name)
    var children = bookmark.children
    if (children)
        children.forEach(c => { PrintBookmark(c, indent + " ") })
}

PrintBookmark(this.bookmarkRoot, "")

color

SecureTypeAccess
NoarrayR/W

Color array specifying the bookmark's text color.

example:

this.bookmarkRoot.children[0].color = color.red

doc

SecureTypeAccess
NoobjectR

The Doc that contains the bookmark.


name

SecureTypeAccess
NostringR/W

The text of the bookmark. See children for an example.


open

SecureTypeAccess
NobooleanR/W

Specifies whether or not to show the bookmark collapsed in the tree.

example:

this.bookmarkRoot.children[0].open = false

parent

SecureTypeAccess
NoobjectR

The Bookmark object of the parent of the bookmark. If the bookmark is the root, then the parent is null.


style

SecureTypeAccess
NonumberR/W

Text style of the bookmark

  • 0: Normal
  • 1: Italic
  • 2: Bold
  • 3: Bold-italic
this.bookmarkRoot.children[0].style = 2 // Bold

methods

createChild

Secure
No

Creates a new bookmark

createChild(cName, cExpr, nIndex)

cName: The text of the new bookmark

cExpr: [optional] JavaScript expression to run when the bookmark is clicked. Default is ""

nIndex: [optional] The 0-based index into the children array. Default is 0

example:

this.bookmarkRoot.createChild("Click Me!", "app.alert('I was clicked')", 0)

execute

Secure
No

Invokes the action of the bookmark

execute()

example:

this.bookmarkRoot.children[0].execute()

insertChild

Secure
No

Moves an existing Bookmark to be a child of this bookmark.

insertChild(oBookmark, nIndex)

oBookmark: The existing Bookmark to move

nIndex: [optional] The 0 based index into the children array. Default is 0


remove

Secure
No

Removes this bookmark and all its children

remove()

example:

this.bookmarkRoot.remove() // Removes all bookmarks

setAction

Secure
No

Sets the bookmark action to the JavaScript expression

setAction(cScript)

cScript: JavaScript expression to run when the bookmark is clicked.

this.bookmarkRoot.children[0].setAction("app.alert('I was clicked')")