jj-lucas
jj-lucas

Reputation: 143

Photoshop Scripting (JS): Duplicate layer set and subs

I would like to duplicate a layer set and all it's contents (layers + layersets) via Photoshop scripting (JS).

Is it possible to completely clone a layer set out of the box, or does anyone known of a known script that suits that purpose?

Upvotes: 1

Views: 1308

Answers (2)

Yuri Khristich
Yuri Khristich

Reputation: 14537

Just in case, if you don't want the dialog window when you duplicate a layer it can be done this way:

var _ = displayDialogs;                     // save original prefs
app.displayDialogs = DialogModes.NO;        // disable dialogs
activeDocument.activeLayer.duplicate();
app.displayDialogs = _;                     // restore original prefs

Upvotes: 0

Anna Forrest
Anna Forrest

Reputation: 1741

The layerset object has a duplicate method on it - so it is just a matter of running something like this:

 app.activeDocument.activeLayer.duplicate()

Upvotes: 1

Related Questions