Skip to main content
Known Participant
April 14, 2024
Answered

layer move with script

  • April 14, 2024
  • 1 reply
  • 420 views

Is there a way to move layers within a layer outside using a script like this?

thank you.

 

 

 

This topic has been closed for replies.
Correct answer femkeblanco

Yes, there is a way.  How you do it depends on whether "c" is a sublayer or an item (for example, a group item). 

var doc = app.activeDocument;
var source = doc.layers["Layer 1"];
var goal = doc.layers["Layer 2"];
source.layers["Sublayer"].move(goal, ElementPlacement.PLACEATEND);
source.pageItems["Group"].move(goal, ElementPlacement.PLACEATEND);

1 reply

femkeblanco
femkeblancoCorrect answer
Legend
April 14, 2024

Yes, there is a way.  How you do it depends on whether "c" is a sublayer or an item (for example, a group item). 

var doc = app.activeDocument;
var source = doc.layers["Layer 1"];
var goal = doc.layers["Layer 2"];
source.layers["Sublayer"].move(goal, ElementPlacement.PLACEATEND);
source.pageItems["Group"].move(goal, ElementPlacement.PLACEATEND);

Known Participant
April 15, 2024

Thank You !