【发布时间】:2015-04-15 22:00:57
【问题描述】:
我正在尝试将 activeDocument 保存为 .psd,但它返回此错误
错误:出现一般 Photoshop 错误。此版本的 Photoshop 中可能不提供此功能。
我的脚本:
#target photoshop
var fileRef = new File(app.path.toString() + "/Samples/template.psd");
var docRef = open(fileRef);
//target text layer
var layerRef = app.activeDocument.layers.getByName("Text");
//user input
var newText = prompt("Editing " + layerRef.name, "enter new text: ");
//change contents
layerRef.textItem.contents = newText;
//save
var savePath = "/Samples/" + newText + ".psd";
var saveFile = new File(savePath);
var saveOptions = new PhotoshopSaveOptions();
saveOptions.alphaChannels = false;
saveOptions.annotations = false;
saveOptions.embedColorProfile = true;
saveOptions.layers = true;
saveOptions.spotColors = false;
app.activeDocument.saveAs(saveFile, saveOptions, true, Extension.LOWERCASE);
app.activeDocument.close();
我想要做的基本上是,一遍又一遍地复制模板文件,只替换文本层的内容,然后将其保存在我在文本层中替换的字符串下。
非常感谢任何提示或帮助。
【问题讨论】:
标签: javascript runtime-error photoshop photoshop-script jsx