Calculate index of character in google doc, on 100th page, Same as how SAVE API call does

Viewed 88

enter image description hereI have really struggled a lot on this problem. I want to find the character index in google docs which have 150 pages.

What I want: exact character index of on the page text click,

Reference: What i saw Save API, gets that information somehow, you can check by following the below steps.

  1. go to page 100th in a google document by scrolling.
  2. open debugger and check SAVE API call after editing in the document.
  3. Check the request body "ibi" property will give you the exact index.

I want to get that index on page text click.

1 Answers

Currently, It is not possible for apps script to capture client side DOM events. Also, there is nothing in the official documentation about capturing selection from document. Though selection capture is possible both in Sheets and Slides.

Related