Guest User

Untitled

a guest
Jul 18th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. function sfwPNG24(saveFile){
  2. var pngOpts = new ExportOptionsSaveForWeb;
  3. pngOpts.format = SaveDocumentType.PNG
  4. pngOpts.PNG8 = false;
  5. pngOpts.transparency = true;
  6. pngOpts.interlaced = false;
  7. pngOpts.quality = 100;
  8. activeDocument.exportDocument(new File(saveFile),ExportType.SAVEFORWEB,pngOpts);
  9. }
  10.  
  11. /*
  12. Incrementing a number inside a text layer then Saving it in PNG
  13. */
  14.  
  15. var layer = activeDocument.layers[0];
  16.  
  17. if (layer.kind == 'LayerKind.TEXT') {
  18. for (var i=1; i < 51; i++) {
  19. layer.textItem.contents = i.toString();
  20. sfwPNG24( '/Applications/MAMP/htdocs/remax/images/img_ui/mapMarkers/mapMarker_'+ i +'.png');
  21. };
  22. };
Add Comment
Please, Sign In to add comment