Hi Forum,
I tried to create and anchor the textFrame, before the word ("WHAT IS COVERED."), which I find...
But the anchored text Frame is inserted at the end of the text or at the beginning of the next paragraphs, which i find (""WHAT IS COVERED."). (screenshot attached for referencing the false place)
Could can body fix this... Pls.
here is my code.....
myDocument = app.activeDocument;
var nF = app.activeDocument.textFrames.add()
nF.geometricBounds = [50,50,30,30];
try {
var myOStyle = myDocument.objectStyles.item("LeftAlign");
myOStyle.name;
} catch (e) {
var myOStyle = myDocument.objectStyles.add({name: "LeftAlign"});
}
nF.applyObjectStyle(myOStyle)
app.select(nF);
app.cut();
//app.cut();
app.findGrepPreferences.findWhat = "What is covered.";
found = app.findGrep();
for (i=0; i<found.length; i++) {
fnd = found[i]
sel = app.select(fnd);
mySourceFrame = app.activeDocument.pages.item(0).textFrames.item(0).parentStory.parag raphs.everyItem();
app.paste(LocationOptions.AT_BEGINNING, fnd.insertionPoints[0]);
}
Advance thanks & regards,