Copy link to clipboard
Copied
Do you know how could i export the files in a normal folder called "number that goes up every output + name inputed in the prompt" instead of the .zip folder it creates? (The starting number should be 64 and go up every other output)
Here is the code I'd like to implement that function in:
var textColor = new SolidColor(); textColor.rgb.hexValue = "000000"; app.activeDocument.activeLayer.textItem.color = textColor; var textLayerName = app.activeDocument.activeLayer.name; var newName = prompt("Enter a new name for the export", "black_" + textLayerName); var exportOptions = new ExportOptionsSaveForWeb(); exportOptions.format = SaveDocumentType.PNG; exportOptions.quality = 100; var file = new File("black " + newName + ".png"); app.activeDocument.exportDocument(file, ExportType.SAVEFORWEB, exportOptions); var textColor = new SolidColor(); textColor.rgb.hexValue = " FFFFFF"; app.activeDocument.activeLayer.textItem.color = textColor; var file2 = new File("white " + newName + ".png"); app.activeDocument.exportDocument(file2, ExportType.SAVEFORWEB, exportOptions); var textColor = new SolidColor(); textColor.rgb.hexValue = " fc82d8"; app.activeDocument.activeLayer.textItem.color = textColor; var file3 = new File("pink " + newName + ".png"); app.activeDocument.exportDocument(file3, ExportType.SAVEFORWEB, exportOptions); var textColor = new SolidColor(); textColor.rgb.hexValue = "63a8e7"; app.activeDocument.activeLayer.textItem.color = textColor; var file4 = new File("blue " + newName + ".png"); app.activeDocument.exportDocument(file4, ExportType.SAVEFORWEB, exportOptions); var textColor = new SolidColor(); textColor.rgb.hexValue = "0c6a27"; app.activeDocument.activeLayer.textItem.color = textColor; var file5 = new File("green " + newName + ".png"); app.activeDocument.exportDocument(file5, ExportType.SAVEFORWEB, exportOptions); var textColor = new SolidColor(); textColor.rgb.hexValue = " a80000"; app.activeDocument.activeLayer.textItem.color = textColor; var file6 = new File("red " + newName + ".png"); app.activeDocument.exportDocument(file6, ExportType.SAVEFORWEB, exportOptions);
Copy link to clipboard
Copied
Do you know how could i export the files in a normal folder called "number that goes up every output + name inputed in the prompt" instead of the .zip folder it creates? (The starting number should be 64 and go up every other output)
I am having problems understanding your request. Could you provide screenshots of the required folder and file structure? Or perhaps write out a step-by-step explanation?
Copy link to clipboard
Copied
var file = new File("black " + newName + ".png");
Here you have a relative path to the file. This usually results in saving to the current application path, i.e. to the photoshop folder.
Insert the command alert(file.fsName) to see the absolute path of the file.
You need to specify the full path to indicate the folder in which to save the file.
The name also uses the layer name, which should not contain prohibited characters for the file name.