…that’s the shit when you don’t understand enough of the used language you use…
I found out, that the whole code I used before using the duplicate command is blocking the duplicate command. I deleted everything and made a variable:
var newdLayer = docRef.activeLayer.duplicate();
And then I was able, to just call this single variable to duplicate my selected Layer with success. The whole code left then is just the following:
#target photoshop
var docRef = activeDocument
var newdLayer = docRef.activeLayer.duplicate();
newdLayer;
It works perfectly.
What I just now don’t know…is there anywhere a list of all photoshop commands in JavaScript? It’s a pain to search hours after hours and days after days for just one single working command (like my duplicate command). At this moment, I have to find out how to select the just duplicated layer (without using its name or index id to stay more flexible, to get it worked even on documents with many layers) and how I apply the “reduce noise” filter. In ESTK 2 are some filters listed under Help->Adobe Photoshop Object Model…but not the filter I need…