Friday, October 23, 2015 InDesign,Extendscript

Insert Inline Image

How to insert inline image in textFrame?

imac

The point is using insertionPoint.

var textFrame = createTextFrame(page, textFrameParams);
textFrame.contents = 'This is tiger image.';
var insertionPoint = textFrame.insertionPoints[13];
var inlineTextFrame = createTextFrame(insertionPoint,{top:0,left:0,bottom:48,right:48});

inlineTextFrame.contentType = ContentType.graphicType;
inlineTextFrame.place( File( currentDir().fullName + '/links/tiger.eps' ) );
inlineTextFrame.fit(FitOptions.CONTENT_TO_FRAME);

More details ... insert-inline-image.js