Javascript: TextFrame.getTextPosition Method
Description
Gets the frame's character position in the document's text (one-based).
Syntax
<void> TextFrame.getTextPosition(<RequestNumberCallback> callback, [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| callback | Receives the current property value. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates TextFrame.getTextPosition in a practical document-editing workflow. It gets the frame's character position in the document's text (one-based).
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
function inspectTextPosition(textFrame) {
textFrame.getTextPosition(
function(result) {
console.log("get text position result:", result);
},
onTxError
);
}