var savefile=new File("~/Desktop/exp.png"); var exportOptions = new ExportOptionsPNG8(); exportOptions.artBoardClipping = true; app.activeDocument.exportFile(savefile, ExportType.PNG8, exportOptions);