3

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)

Andrea
  • 11,801
  • 17
  • 65
  • 72

1 Answers1

1

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
Julien Grégoire
  • 16,864
  • 4
  • 32
  • 57