FORUMS: list search recent posts

How do I duplicate multiple PS layers (lots of them!) so that each layer is below its copy

COW Forums : Adobe Photoshop

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
John Russell
How do I duplicate multiple PS layers (lots of them!) so that each layer is below its copy
on Jun 18, 2014 at 12:57:33 pm

Anyone know how to duplicate multiple Photoshop layers (hundreds of them!) so that each layer is below its copy, i.e. rather than all the copies being in one group and the original in the other (as normal)? Hope this posted in correct forum. Would be grateful of any advice.

E.g. from this:
layer4
layer3
layer2
layer1

Duplicated to this:

layer4 copy
layer4
layer3 copy
layer3
layer2 copy
layer2
layer1 copy
layer1

Rather than this:
layer4 copy
layer3 copy
layer2 copy
layer1 copy
layer4
layer3
layer2
layer1


Return to posts index

Jonathan Ziegler
Re: How do I duplicate multiple PS layers (lots of them!) so that each layer is below its copy
on Jun 19, 2014 at 5:59:23 pm

Not sure what version of PS you are using, but here is a simple script I lifted from the Photoshop CC Javascript guide ("ArtLayer.jsx" page 62-4) and it seems to work here on CC (if you want to change the sort order, change "ElementPlacement.PLACEAFTER" to "ElementPlacement.PLACEBEFORE"):

// sort the layers by name
for (var x = 0; x < app.activeDocument.layers.length; x++) {
for (var y = 0; y < app.activeDocument.layers.length - 1 - x; y++) {
// Compare in a non-case sensitive way
var doc1 = app.activeDocument.layers[y].name
var doc2 = app.activeDocument.layers[y + 1].name
if (doc1.toUpperCase() > doc2.toUpperCase()) {
app.activeDocument.layers[y].move(app.activeDocument.layers[y+1], ElementPlacement.PLACEAFTER)
}
}
}

If you are going to use this often, I suggest saving it in a plain text editor as sort.jsx or something similar (the .jsx extension is necessary for PS for most current versions) in the startup scripts folder for photoshop so it loads everytime and you can attach a hotkey, too.

Lemme know how it works.

Save early. Save often.

Jonathan Ziegler

http://www.electrictiger.com
520-360-8293


Return to posts index

Jovan Strel
Re: How do I duplicate multiple PS layers (lots of them!) so that each layer is below its copy
on Jul 10, 2014 at 11:06:13 am

yeah i think there a easier solution, you could just record a action doing following steps
1. Copy leyer or ctrl+J
2. Layer>Arange>Move down layer

end script, assign a shortcut and that would be that


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]