Bookmark
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
| Secure | Type | Access |
|---|---|---|
| No | array | R |
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
| Secure | Type | Access |
|---|---|---|
| No | array | R/W |
Color array specifying the bookmark's text color.
Example
this.bookmarkRoot.children[0].color = color.red
doc
| Secure | Type | Access |
|---|---|---|
| No | object | R |
The Doc that contains the bookmark.
name
| Secure | Type | Access |
|---|---|---|
| No | string | R/W |
The text of the bookmark. See children for an example.
open
| Secure | Type | Access |
|---|---|---|
| No | boolean | R/W |
Specifies whether or not to show the bookmark collapsed in the tree.
Example
this.bookmarkRoot.children[0].open = false
parent
| Secure | Type | Access |
|---|---|---|
| No | object | R |
The Bookmark object of the parent of the bookmark. If the bookmark is the root, then the parent is null.
style
| Secure | Type | Access |
|---|---|---|
| No | number | R/W |
Text style of the bookmark:
- 0: Normal
- 1: Italic
- 2: Bold
- 3: Bold-italic
Example
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 the 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 the 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)
Example
this.bookmarkRoot.children[0].setAction("app.alert('I was clicked')")
Resources
Revu 21
Revu JavaScript
JavaScript