A Bookmark object represents a single bookmark applied to some text in the document.
Existing Bookmark objects can be obtained through commands like:
Document.allBookmarks
Document.bookmarkWithName
Document.bookmarksWithDisplayName
Text.bookmarksAtIndex
Bookmark Type Commands
Bookmark.selectedBookmark [requireVisible] v2.0.5
Returns the first Bookmark object applied to text selected in the active document. If requireVisible is @true this will return the first visible (non-hidden) bookmark; if @false is given returns the first hidden bookmark. If the optional requireVisible argument is not specified (or the @undefined value is given) then this will return the first hidden or visible bookmark.
If no such bookmark is selected, returns the @undefined value.
Bookmark.selectedBookmarks [requireVisible] v2.0.5
Returns an array of all Bookmark objects applied to text selected in the active document. The requireVisible argument works here exactly as in the selectedBookmark command.
If no such bookmarks are selected, returns the @undefined value.
Bookmark.newWithNameAddedToTextSelection bookmarkName, selection v2.0.5
Adds a new explicitly-named bookmark to the text specified by the given TextSelection object. Returns the freshly added Bookmark object, and selects it in the document. The given name must be unique across the entire document or this command will do nothing and return the @undefined value.
Bookmark.newWithNameAddedToTextAndRange bookmarkName, text, range v2.0.5
Adds a new explicitly-named bookmark to the text specified by the given Text and Range objects. Returns the freshly added Bookmark object, and selects it in the document. The given name must be unique across the entire document or this command will do nothing and return the @undefined value.
Bookmark.newAutonamedAddedToTextSelection isHidden, selection v2.0.5
Adds a new automatically-named bookmark to the text specified by the given TextSelection object. If isHidden is @true, then this bookmark is not shown to the user. Returns the freshly added Bookmark object, and selects it in the document.
Bookmark.newAutonamedAddedToTextAndRange isHidden, text, range v2.0.5
Adds a new automatically-named bookmark to the text specified by the given Text and Range objects. If isHidden is @true, then this bookmark is not shown to the user. Returns the freshly added Bookmark object, and selects it in the document.
Bookmark Object Properties
.name v2.0.5
Returns the name for the bookmark, which is unique across the entire document. This name is used to reference the bookmark internally (eg: by cross-references) and you can think of it as defining the bookmark’s identity.
For hidden and automatically-named bookmarks this name is a unique internal name that is never displayed to the user. Read-only.
.displayName v2.0.5
Returns the name of the bookmark as it is displayed to the user. For bookmarks created with an explicit name (eg: via the menu Add Bookmark As), the bookmark’s name is its display name. For automatically-named bookmarks, the display name will be some form of the text to which the bookmark is applied. Read-only.
.isHidden v2.0.5
Returns @true if the bookmark is not shown to the user, otherwise @false. Read-only.
.isAutomaticallyNamed v2.0.5
Returns @true if the bookmark is automatically named, otherwise @false. Read-only.
Returns the Text object to which this bookmark is applied, or the @undefined value if it is not in a document. Read-only.
Note: the returned text object follows reference semantics and holds the entire text area where the bookmark exists (eg: the whole document body).
.markedTextRange v2.0.5
Returns the Range object representing the specific character range in the markedText object to which the bookmark is applied. Returns the @undefined value if the bookmark is not applied in a document. Read-only.
Bookmark Object Commands
.setName newName, [isRetargetCrossRefs] v2.0.5
Changes the name of the bookmark to the given name. This command will fail and do nothing if the bookmark is automatically named or the new name is not unique. Returns @true if the renaming was successful, or @false if it failed.
Optionally this command can retarget all existing cross-reference in the document to use the new bookmark name (ie: cross-reference to this bookmark will remain intact despite the change in its name). By default this argument is @true and cross-references will be retargeted.
.remove v2.0.5
Removes the bookmark from the text to which it is applied; the bookmark’s name is no longer considered to exist in the document, eg: cross-references to the bookmark will display as missing.
Previous Chapter Attributes Object |
<< index >> |
Next Chapter Comment Object |