Copy link to clipboard
Copied
Hoping someone can help me with a script.
I always have a layer called "contents" in my indesign files. Sometimes I have an object on another layer that needs to be on this "contents" layer. It will speed up my process if I can script this (to assign a shortcut) so I dont have to drag the coloured dot in the layers panel to another layer. Is there a way to script this?
I saw another post with a script from Jongware but it doesn't seem to work for me. Thanks.
Hi @danielw42205661,
How do we identify the object that needs to be moved? If it's named then the following script should work. Here I am assigning the object with name movetf to the layer named contents
app.documents[0].pageItems.itemByName("movetf").itemLayer = app.documents[0].layers.itemByName("contents")
If there is any other criteria for choosing the object then we will have to tweak the code.
Edit:- I see you talk about selection, so if you want to move the selected object to the
...Copy link to clipboard
Copied
Hi @danielw42205661,
How do we identify the object that needs to be moved? If it's named then the following script should work. Here I am assigning the object with name movetf to the layer named contents
app.documents[0].pageItems.itemByName("movetf").itemLayer = app.documents[0].layers.itemByName("contents")
If there is any other criteria for choosing the object then we will have to tweak the code.
Edit:- I see you talk about selection, so if you want to move the selected object to the contents layer then the following should work
app.selection[0].itemLayer = app.documents[0].layers.itemByName("contents")
P.S.:- The code does not have any error checks
-Manan
Copy link to clipboard
Copied
Thank you so much, Manan. Works exactly as I'd hoped 🙂
Find more inspiration, events, and resources on the new Adobe Community
Explore Now