thanks one million times for this reply, it was exactly what i couldn't figure out regarding how to skip the first occurrence of the anchor. i appreciate this immensely. I've changed my code to reflect your suggestions and it works as desired for now. var anchoredItems = app.documents[0].stories.everyItem().pageItems.everyItem().getElements(); for( var n=0; n<anchoredItems.length; n++ ) { // If anchored object is first in a text line, do nothing: if( anchoredItems .parent == anchoredItems .parent.lines[0].characters[0] ){ continue }; //get contents of paragraph - cant use just lines because the text is multiline var thistext = anchoredItems .parent.paragraphs.item(0).contents; //grab my index location for insertion var tablocation=thistext.indexOf('\t'); //set up insertion var myIP=anchoredItems .parent.paragraphs.item(0).insertionPoints.item(tablocation+1) ; //move anchor anchoredItems .anchoredObjectSettings.insertAnchoredObject(myIP, AnchorPosition.INLINE_POSITION); }; However i now have another question, which is: is there a better way to move the anchors? You mentioned the move() method but the anchors I deal with are all in-line; move() requires 2 coordinate inputs if I remember correctly. You mentioned the anchor resides as a child of the (Â¥) character in the line? I believe I've moved it previously but once it moves, say via grep, the anchored object, in my case a rectangle object, fails to retain the image placed inside. Whats the best way to handle moving where the anchored object is inserted at while still retaining the contents inside? The way I have it above seems to work fine, but I've been doing this long enough to know there's got to be a better way. As always, thanks in advance for your time, it is greatly appreciated.
... View more