我需要制作很多图形按钮。我有2层
我不确定如何编写此操作或是否需要脚本。我需要将文本层从1开始并遵循此进程。
等。 。所有这一切都是48.所以这将自动生成48张图片。这可以用"动作"来完成。还是我需要学习脚本?
保存
答案 0 :(得分:1)
你需要一个脚本,但它会变得相当简单
function main() {
//this just checks if you have a text layer selected
try {
var textLayer = activeDocument.activeLayer.textItem
} catch (e) {
alert("active layer isn't a text layer");
return
};
var loops = 48,
pngSaveOptions = new PNGSaveOptions(),
outputFolder = Folder.selectDialog('', Folder.desktop); //this will ask for an output folder
for (var i = 0; i < loops; i++) {
var myNum = i + 1;
textLayer.contents = myNum; //this will change layer contents to number only. if you need some text here, write it in quotes like textLayer.contents = "my text" + myNum;
activeDocument.saveAs(new File(outputFolder + "/w" + myNum + ".png"), pngSaveOptions, true, Extension.LOWERCASE);
}
}
app.activeDocument.suspendHistory("temp", "main()");