I want to change the position of a picture located within a multistate object.
I have joined two rectangles (one of which contains a placed bitmap) to form a multistate object together. But now I can't address these rectangles as rectangles anymore, only as pageitems. So:
app.activeDocument.multiStateObjects[0].states[0].rectangles.length
gives 0.
while
app.activeDocument.multiStateObjects[0].states[0].pageItems.length
gives 1.
Since I can't address the picture frame as a rectangle anymore, I can't do anything with the picture it contains... (I would like to apply the fit function on it: myFrame.fit(FitOptions.CONTENT_TO_FRAME), but then myFrame should be a rectangle, not just a pageItem)
The pageItem is most likely a group. When you create a multistateObject, it creates groups for each state and these groups become the parents of the pageItens you had. So you should be able to access your rectangles like this:
app.activeDocument.multiStateObjects[0].states[0].groups[0].rectangles
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With