[英]I am a Photoshop scripting beginner. I want to ask everyone how to replace the text layer
我是 Photoshop 腳本初學者。 想請教大家如何用Photoshop替換photoshop中的文本圖層讀取外部txt文件的內容。 我很生氣。
首先加載外部文本文件的內容:
var extText = new File("path/to/external.txt");
if( extText ) {
extText.open('r');
var content = "";
while(!extText.eof) contents += extText.readln() + "\n";
extText.close();
};
然后使用內容來更新您的文本層:
var textLayer = app.activeDocument.artLayers.getByName("layer-name");
textLayer.textItem.contents = contents;
希望這能幫助您減少煩惱;)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.