0
이것은 일러스트 레이터의 extendscript입니다. 기본적으로 javascript입니다. 두 번째 팝업을 한 번만 표시하고 싶습니다. 변수가 이미 존재하지 않는다면 알려주려고했지만 입력을 요청하지 않으면 알려 주려고했습니다. 내가 뭘 잘못하고 있는거야?간단한 자바 스크립트 루프
#target illustrator
if (app.documents.length > 0) {
var replaceThis = prompt('What font do you want to replace?','')
for (i = 0; i< app.activeDocument.textFrames.length; i++) { //loop through the layers
var textArtRange = app.activeDocument.textFrames[i].textRange;
var fontSize = textArtRange.characterAttributes.size;
//var replaceThis = "10";
//alert("replace this:" + replaceThis);
// alert("current font size" + fontSize);
if (fontSize == replaceThis) {
Replacefont();
}
function Replacefont() {
//var newSize = "90";
if (!newSize) {
var newSize = prompt('Replace '+ replaceThis +'pt with:','')
}
textArtRange.characterAttributes.size = newSize;
alert("yay");
}
}
}