parent is Doc and doesn't have texts
If I use
var sto = tp.parentStory;
var txt = sto.texts[0];
var start = tp.storyOffset.index;
var charactersToDelete = txt.characters.itemByRange(start, start+tp.length-1);
charactersToDelete.remove();
I always have invalid object
I have a conceptual doubt , if storyOffset.index is regarding the story in the cell (and that's right, with 2char before in the cell it says 2) if I start referencing the entire table it should count also other cells values so a bigger number.
Maybe the path is right, but i'm missing the right offset.
Thanks
Hi @giovanni_4827 ,
I looked it up. You are right. With tp.parentStory we will not get very far concerning the text of the placeholder.
However, property storyOffset should be an insertionPoint in text.
So it should be possible to access the text of a table cell with:
tp.storyOffset.parent.texts[0]
With tp.storyOffset you'll get an insertionPoint.
In case the insertionPoint is inside a table cell, the parent should be the table cell itself.
And texts[0] of the table cell leads you to the text of the table cell.
But I have to test this first.
Well, I have to work on this later.
My InDesign 2025 version 20.2 is currently crashing every time when I click the View menu…
Regards,
Uwe Laubender
( Adobe Community Expert )