5 Replies Latest reply on Apr 20, 2016 9:47 AM by williamadowling

    Script to make multiple selected layers in to one layer and export

    yshkrish Level 1

      Hi ,

      Is there any script which could make selected particular layers into single png of one artboard.

      suppose i created a list box name mylist1


      var docRef = app.activeDocument;

      for (var i = 0; i < docRef.layers.length; i++)


      myList1.add ("item", docRef.layers[i].name);



      I want to form mylList1.selected multiple items to one png file using


      var exportOptions = new ExportOptionsPNG24();

      var type = ExportType.PNG24;

      var fileSpec = new File("c:/");

      exportOptions.antiAliasing = false;

      exportOptions.transparency = false;

      exportOptions.saveAsHTML = true;

      app.activeDocument.exportFile( fileSpec, type, exportOptions );


      I could write code for multiple pngs and other formats.but single png (or other formats) for selected layers is difficult for me.


      Please anyone help me writing the code.


      Thank you.