I have this code so far:
var targetDoc = DocumentApp.getActiveDocument();
var cursor = targetDoc.getCursor().getElement();
var cursorParent = cursor.getParent();
var cursorPoint = cursorParent.getParent().getChildIndex(cursorParent);
But this brings back the child of the cursors parent's parent which is always 0. I cannot find a way to get the childIndex of the cursor's own parent.
Does anyone know how to do this?
Kind Regards.