11 Replies Latest reply on Mar 26, 2015 7:42 AM by CookieWookiee

    Move layer group script

    jim_blandford

      Found this script to do what I want but cannot get it to work with Photoshop CC 2014 on OSX 10.9.4.

       

      // tell extendscript toolkit which adobe application to target;
      #target photoshop
      // determine the document on which to work;
      var myDoc = app.activeDocument;
      // define which open document to get the layergroup from;
      // one could also open a document from a specific position on the harddrive. 
      var theLayerSetDoc = app.documents.getByName(“Watermark1600.psd”);
      // switch photoshop’s focus to the group-document to be able to work with it;
      app.activeDocument = theLayerSetDoc;
      // define the group, actually one could avoid the variable and just process it directly;
      var theSet = theLayerSetDoc.layerSets.getByName(“Watermark”);
      // do the duplication;
      theSet.duplicate(myDoc,ElementPlacement.PLACEATBEGINNING);
      


      Keep getting

       

      Error 8: Syntax error.

      Line: 7

      ->  var theLayerSetDoc = app.documents.getByName(“Watermark1600.psd”);

       

      Document name matches perfectly.

       

      Had this working under PS CC version before 2014, but remembered I had to make a very subtle change to get a script originally for CS to work for CC? Cannot remember what it was!

       

      Help much appreciated, thanks in advance.