Images in a multistate object

I want to change the position of an image that is inside a nested object.

I have merged two rectangles (one of which contains the placed bitmap) to form a layered object together. But now I cannot address these rectangles as rectangles anymore, only as pageitems. So:

app.activeDocument.multiStateObjects[0].states[0].rectangles.length

      

gives 0.

and

app.activeDocument.multiStateObjects[0].states[0].pageItems.length

      

gives 1.

Since I can no longer refer to the image frame as a rectangle, I cannot do anything with the image it contains ... (I would like to apply a match function to it: myFrame.fit(FitOptions.CONTENT_TO_FRAME)

but then myFrame

must be a rectangle, not just pageItem

)

+3


source to share


1 answer


pageItem

most likely a group

. When you create multistateObject

, it creates groups for each state, and these groups

become parents

for pageItens

that you had. Thus, you should be able to access your rectangles like this:



app.activeDocument.multiStateObjects[0].states[0].groups[0].rectangles

      

+1


source







All Articles