2014-05-22 2 views
0

왜 이것이 작동하지 않는지 잘 모름. 원하는 레이어를 선택했는데 해당 레이어의 pathItems이 선택되거나 변경되지 않았습니다.선택한 레이어의 모든 개체 선택

var docRef = app.activeDocument; 

var layerRef = docRef.layers; 

for (i=0; i<docRef.layers.length; i++){ 
    if (layerRef[i].name === "Perflines"){ 

     var perfColor = new CMYKColor(100, 100, 0, 0); 

     layerRef[i].pathItems.selected = true; 

     layerRef[i].pathItems.strokeColor = perfColor; 

     layerRef[i].pathItems.strokeWidth = 1; 

     alert(layerRef[i].name); 

     } 
    } 

답변

2

PathItems는 컬렉션이며 속성을 선택하지 않았습니다.

http://yearbookmachine.github.io/esdocs/#/Illustrator/PathItems 또한 단일 PathItem 선택된 어느 프로퍼티를 참조 없다.

http://yearbookmachine.github.io/esdocs/#/Illustrator/PathItem

당신은 다른 방법으로 개체를 선택해야 참조하십시오.

어쩌면이 방법 (테스트되지 않음)

var items = layer.pageItems; 
for(var i = 0;i < items.length;i++){ 
    if(items[i] instanceOf PathItem){ 
    items[i].selected = true; 
    } 
} 

http://yearbookmachine.github.io/esdocs/#/Illustrator/PageItem

참조
관련 문제