Copy link to clipboard
Copied
Hi Scripters,
I make a Grep research on a "XXX" para style and I want, after, to manipulate the text frame containing the paras I found!
So, is this code correct to begin?
var myDoc = app.activeDocument;
app.findGrepPreferences = app.changeGrepPreferences = null;
app.findGrepPreferences.appliedParagraphStyle = "XXX";
var myFound = myDoc.findGrep();
for(var F = 0; F < myFound.length; F++)
{
var myTextFrame = myFound
.parent.textFrames; //………
}
Thanks in advance!
(^/)
Copy link to clipboard
Copied
1. Open the ESTK, open the Console.
2. Select some text in an InDesign document.
3. In the ESTK console, enter app.selection[0].parent and press Enter
4. What does the console reply?
P.
Copy link to clipboard
Copied
Hi Peter!
app.selecton[0].parent => Result : [object Story]
app.selecton[0].parent.textFrames => Result : [object TextFrames]
… So, I'm right!?
(^/)
Copy link to clipboard
Copied
Try this:
app.selecton[0].parent.textFrames.length
=> Result: 0
So that doesn't work.
Go to the OMV, look under any text property, e.g. Character. You'll see that it has a property 'parent', but you already found that that doesn't work. After 'parent' is 'parentTextFrames'. Try that:
app.selection[0].parentTextFrames
and see what happens.
Be adventurous!
P.