Copy link to clipboard
Copied
I'm trying to add a small circle as an inline object, but something's off. I suspect its my insertion point, but I'm not sure. Can anyone help?
var myPage = app.activeDocument.layoutWindows[0].activePage;
var bounds = {geometricBounds:[10,10,20,20]};
var content = " Lorem Ipsum";
var myTextFrame = createTextFrame(bounds,content);
var insertPoint = myTextFrame.parentStory.insertionPoints[0]; //I think the problem may be here
var circle = insertPoint.ovals.add({geometricBounds:[55, 10, 55.5, 10.5]});
function createTextFrame(myTextFrameBounds, myTextFrameContents){
var myFrame = myPage.textFrames.add(myTextFrameBounds);
myFrame.contents = myTextFrameContents;
}
The problme is that your "createTextFrame" function does not actually return a textframe.
Add a "return myFrame;" at the end of it and you should be ready to go.
This new forum is HORRIBLE!!!
Copy link to clipboard
Copied
What goes in the circle? A picture? Why must it be scripted?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
The problme is that your "createTextFrame" function does not actually return a textframe.
Add a "return myFrame;" at the end of it and you should be ready to go.
This new forum is HORRIBLE!!!
Copy link to clipboard
Copied