-
-
Save tinyx3k/7301d0a82f6cc03c34d3013aa1299615 to your computer and use it in GitHub Desktop.
Photoshop Javascript to increment text layer value and save for Web (in a loop)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sfwPNG24(saveFile){ | |
var pngOpts = new ExportOptionsSaveForWeb; | |
pngOpts.format = SaveDocumentType.PNG | |
pngOpts.PNG8 = false; | |
pngOpts.transparency = true; | |
pngOpts.interlaced = false; | |
pngOpts.quality = 100; | |
activeDocument.exportDocument(new File(saveFile),ExportType.SAVEFORWEB,pngOpts); | |
} | |
/* | |
Incrementing a number inside a text layer then Saving it in PNG | |
*/ | |
var layer = activeDocument.layers[0]; | |
if (layer.kind == 'LayerKind.TEXT') { | |
for (var i=1; i < 51; i++) { | |
layer.textItem.contents = i.toString(); | |
sfwPNG24( '/Applications/MAMP/htdocs/remax/images/img_ui/mapMarkers/mapMarker_'+ i +'.png'); | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment