[ExtendScript] How to put a page item into another page item?
Let’s say I have two page items in my document: a circle and a square. I move the square so its top left corner is in the centre of the circle. I cut (cmd-X) the square. It’s gone. I select the circle and I “Paste Into” (cmd-alt-V).
The square is now clipped by the circle frame:

So, I want to do that via the scripting API. With the above example, I can select the circle and do:
$.writeln(app.activeDocument.selection[0].rectangles.length)and the result is 1, which is correct. There is one rectangle IN that circle.
What I want to know is… how do I put the square in the circle via ExtendScript or UXP? It must be easy, but I can’t quite get it. I want `myPageItem.rectangles.add` to do it, but it only seems to want a Layer, which makes no sense.
– Mark

