예는 가능하다 ... 당신 또는 누군가를 위해 의미가 아니에요 ... 텍스트를 무시하십시오. 편집 텍스트 상자에 대한 UI 패널을 만들 수 있습니다. 여기에 필요한 것의 기초가 있습니다.
// dialogue
var dlg = new Window ("dialog", "Photoshop UI");
dlg.add ("statictext", undefined, "Do that thing");
var textContents = "No text";
// check to see if active layer is text
if (app.activeDocument.activeLayer.kind == "LayerKind.TEXT")
{
var textItemRef = app.activeDocument.activeLayer.textItem;
textContents = textItemRef.contents;
}
// add edit text
var edText = dlg.add ("edittext", [0,0,220,20]);
edText.text = textContents;
edText.alignment = "left";
edText.active = true;
//button group
var btnGroup = dlg.add ("group");
btnGroup.orientation = "row";
btnGroup.alignment = "center";
btnGroup.orientation = "column";
// add buttons
btnGroup.add ("button", undefined, "OK");
btnGroup.add ("button", undefined, "Cancel");
dlg.center();
var myReturn = dlg.show();
if (myReturn == 1)
{
// set checkboxes and input here
var ask = edText.text;
// call the function to change text
doThatThingThatYouDo(ask);
}
function doThatThingThatYouDo(str)
{
// check to see if active layer is text
if (app.activeDocument.activeLayer.kind == "LayerKind.TEXT")
{
var textItemRef = app.activeDocument.activeLayer.textItem;
textItemRef.contents = str;
}
alert(str);
}
텍스트로 새 PSD를 만들면 실제로 표시됩니다. 텍스트 레이어를 읽고 변경하도록 허용합니다. 다행히도 어떻게 작동하는지보고 자신의 프로젝트에 사용할 수 있기를 바랍니다.
사용중인 포토샵의 버전에 따라 다르지만 다음과 같이 사용할 수 있습니다. http://stackoverflow.com/questions/14571008/photoshop-scripting-changing-text-of-a-text-layer – Conan