-
Scripting Photoshop: Duplicate active Layer
Hey Folks!
I’m a real newbie to scripting photoshop. Also, I do not really know JavaScript. I work with ExtendScript Toolkit 2. I trie to learn JS but I have a problem I do not understand and I hope you will help me out.
I’ve written a dialogue, this works fine. But the effect don’t starting when performing a click on ‘OK’. The following is what I start with:
#target photoshopfunction main() {
if ( app.documents.length <= 0) {
alert( uiAlertDocumentMustBeOpened );
return;
}var newLayer = docRef.activeLayer.duplicate();
newLayer.selected = true;When I start this script with the ‘Play’ Button in the top right corner of ESTK 2, no error occures, but nothing happened in Photoshop. I tried some other ways to get Photoshop duplicate the active Layer, but nothing worked.
Thanks for every answer.