可以用这个替换图层的代码试试吗?因为是只读我没法改
$$#target photoshop
// Function to change the content of the selected text layer
function changeTextLayerContent() {
try {
var activeLayer = app.activeDocument.activeLayer;
if (activeLayer.kind === LayerKind.TEXT) {
// 处理文本中的特殊字符,确保不会引发语法错误
var textContent = "{resultText}"; // 使用双引号包裹字符串
activeLayer.textItem.contents = textContent;
return true;
} else {
return false;
}
} catch (e) {
return false;
}
}
// Variable to store the result of the operation
var v = changeTextLayerContent();
// Output the result
v;