0
다양한 텍스트 및 경로 항목이 포함 된 일러스트레이터 문서가 있습니다. 모든 텍스트 항목을 반복하고 그 색상과 두 가지 속성을 변경하고 싶습니다. 그런 다음 항목 이름에 따라 같은 이름의 다른 항목과 그룹화합니다. 거의 작동하는 스크립트가 있습니다. 문제는 일부 항목을 남겨 두거나 불일치하게 무시한다는 것입니다. 때로는 그것들을 영향을 미치기도하고, 무시할 때도 있습니다.텍스트 항목을 반복하는 일러스트 레이터 페이지
//Selects the graph before to scale them and turns off the pixel align so that values of 1 decimal place can be applied to strokes
doc.selectObjectsOnActiveArtboard();
var sel = doc.selection;
sel.pixelAligned=false
var item
var xLabels = layer.groupItems.add(); //create group for xAxis
xLabels.name="xLabels"
var yLabels = layer.groupItems.add(); //create group for xAxis
yLabels.name="yLabels"
var yTicks = layer.groupItems.add(); //create group for xAxis
yTicks.name="yTicks"
//Loops through ungrouped text items and set horizontal scale, spot black and tabular lining on figures
for (var i = 0; i < layer.textFrames.length; i++) {
item=layer.textFrames[i];
$.writeln (item)
item.textRange.characterAttributes.textFont = textFonts.getByName("Metric-Regular");
item.textRange.characterAttributes.figureStyle=FigureStyleType.TABULAR
item.textRange.characterAttributes.fillColor=myBlack;
//move labels on xAxis into the same group
if (item.name=="xAxisLabel") {
item.moveToEnd(xLabels);
}
//move labels on yAxis into the same group
if (item.name=="yAxisLabel") {
item.moveToEnd(yLabels);
};
};
for (var i = 0; i < layer.pathItems.length; i++) {
item=layer.pathItems[i];
if (item.name=="yAxisTick") {
item.moveToEnd(yTicks);
};
};