What version of Photoshop are you using? I think the problem is you have multiple layers selected when you do the duplicate step. With newer version that will dupe all the selected layers. By doing three dupe steps you are in effect duping all the selected layers three times.
I think you should either do only one dupe step or change the layer selection to only one layer after getting the selected layers and before the dupe step.
I am on CC.
And you are correct.
I had tried to use my varible formed by the getSelected function to duplicate the layers but found when I used this:
lay1 = FSTdoc.activeLayer.duplicate(HLDRdoc, ElementPlacement. PLACEATBEGINNING);
My next question is this.
Do I even need the getSelected function by paul mr anymore?
Or can I collect multiple layers(art/type/path) and layersets just using activeLayer.
I will do my own tests but since I have someone with experinece on the hook I wanted to ask your opinion.
Thanks again for your help.
You should not need GetSelectedLayers to dupe the layers. However when there is more than one layer selected when you dupe that method only returns the top most layer so I think you will need to change the way you reference the duped layers in the new document.
Oh I see.
Perhaps I should Deselect everything and use getSelected to select, dupe and deselect in a for loop?
1 person found this helpful
I think if you add the line
var theLayers = GetSelectedLayers();
the script will do what you want.
That works great!