Legend
August 10, 2025
Answered
When there is no selection, how can I obtain all paragraphs and table cells in the document?
- August 10, 2025
- 1 reply
- 908 views
If no objects are selected, all text Frames in current document will be processed.
I have two targets:
1. Text paragraphs outside the table.
2. Cells inside the table.
How can I get them?
Like this:
obj.texts[0].appliedParagraphStyle)=parStn;
obj.texts[0].tables.everyItem().cells.everyItem().texts[0].appliedParagraphStyle = bodyParStn;This is my code above.
It seems that it can only go up to this point: alert(“here”);
There is no response below that.
var myDocument = app.documents.item(0);
var myStory = myDocument.stories;
for (var s = 0; s < myStory.length; s++) {
alert("here");
var what = "^.";
var res = getGrepSearch(what, app.activeDocument);
for (var f = 0; f <res.length; f++) {
var obj = app.selection[f];
...
}
}


