Copy link to clipboard
Copied
Hi sir
I was trying to insert a rectangle frame tool inside a text frame using this code
> it does not place it inside the text frame
That's because you place it on the page, not in the frame. You should then move the rectangle into the frame (it's not possible to place a rectangle into a text frame directly). Add this to your script:
rect.anchoredObjectSettings.insertAnchoredObject (
selectedTextFrame.insertionPoints[0],
AnchorPosition.INLINE_POSITION
)
Copy link to clipboard
Copied
> it does not place it inside the text frame
That's because you place it on the page, not in the frame. You should then move the rectangle into the frame (it's not possible to place a rectangle into a text frame directly). Add this to your script:
rect.anchoredObjectSettings.insertAnchoredObject (
selectedTextFrame.insertionPoints[0],
AnchorPosition.INLINE_POSITION
)
Find more inspiration, events, and resources on the new Adobe Community
Explore Now