Copy link to clipboard
Copied
Hi all, I need a javascript method to replicate the following, as seen in the Photoshop and Illustrator object models:
pageItem.move( relativeObject, ElementPlacement )
I feel like I'm missing something obvious, but I've been looking for a while. Surely someone has tried to do this before?
pageitem.bringToFront() will bring it to the top of layer, sendToBack() at bottom of layer. You can pass another pageitem reference to bring object in front or behind it.
Copy link to clipboard
Copied
pageitem.bringToFront() will bring it to the top of layer, sendToBack() at bottom of layer. You can pass another pageitem reference to bring object in front or behind it.
Copy link to clipboard
Copied
This is perfect. Thank you!
Copy link to clipboard
Copied
Hi @nickcombs, wow I can't believe I've never noticed this before! You're right that Indesign's PageItem.move doesn't work like Illustrator/Photoshop. It seems to only allow you to move to a new Layer, Page, Spread or Document. Best I could find quickly was to use another layer and shuffle the items back and forth to adjust the order. Not great. Hopefully someone will have a better idea!
- Mark
Edit: Thanks @brian_p_dts!
Copy link to clipboard
Copied
Do you mean to tell me that ID, PS and AI APIs have practically nothing in common?!?! Perish the thought 😆
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Hi @nickcombs , there’s also bringForward() and sendBackward(), which moves the object up or down the z-order.
//move the selected object up
app.activeDocument.selection[0].bringForward()
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more