Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

Anchoring textFrame

$
0
0

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,

rkids...anchor.png


Viewing all articles
Browse latest Browse all 15932

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>