gpt4 book ai didi

javascript - 启动脚本 Photoshop 出现错误 25

转载 作者:行者123 更新时间:2023-12-03 01:34:19 25 4
gpt4 key购买 nike

所以我想编写一个脚本,根据我们输入的内容更改文本,但启动脚本时出现错误 25。

错误出现在第 33 行(changeTextLayerContent(Invoice1, 'Date 1', date)),提前谢谢大家!

function changeTextLayerContent(doc, layerName, newTextString) {
for (var i = 0, max = doc.layers.length; i < max; i++) {
var layerRef = doc.layers[i];
if (layerRef.typename === "ArtLayer") {
if (layerRef.name === layerName && layerRef.kind === LayerKind.TEXT) {
layerRef.textItem.contents = newTextString;
}
} else {
changeTextLayerContent(layerRef, layerName, newTextString);
}
}
}

name1 = prompt("Entre le nom 'Michel Dupont'", "")
adressStreet = prompt("Entre l'adresse '1 rue de la Paix'", "")
adressCP = prompt("Entre le code postal", "")
adressCity = prompt("Entre la ville", "")
adressCountry = prompt("Entre le code du Pays 'FR'", "")
date = prompt("Entre la date de la commande (sans l'année) '1 janvier'", "")
year = prompt("entre l'année", "")
price = parseInt(prompt("Entre le prix (avec une virgule '149,99')", ""))
objectName = prompt("Entre le nom complet de l'objet", "")
ASIN = prompt("Entre l'ASIN (à trouver sur la page Amazon)", "")

adressFull = name1 + "\
" + adressStreet + "\
" + adressCity +", " + adressCP + "\
" + adressCountry
date = date + " " + year
invoiceNumber = "AEU-INV-FT-" + year + "-" + Math.floor(Math.random()*100000000)
orderNumber = Math.floor(Math.random()*1000) + "-" + Math.floor(Math.random()*10000000 + "-" + Math.floor(Math.random()*10000000

changeTextLayerContent(Invoice1, 'Date 1', date);
changeTextLayerContent(Invoice1, 'Date 2', date);
changeTextLayerContent(Invoice1, 'Number 1', invoiceNumber);
changeTextLayerContent(Invoice1, 'Number 2', orderNumber);
changeTextLayerContent(Invoice1, 'Price 1', price + " €");
changeTextLayerContent(Invoice1, 'Adress 1', adressFull);
changeTextLayerContent(Invoice1, 'Adress 2', adressFull);
changeTextLayerContent(Invoice1, 'Adress 3', adressFull);

最佳答案

最后你漏掉了两个圆括号:

orderNumber = Math.floor(Math.random()*1000) + "-" + Math.floor(Math.random()*10000000 + "-" + Math.floor(Math.random()*10000000

关于javascript - 启动脚本 Photoshop 出现错误 25,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51145467/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com