2017-04-19 1 views

답변

1

필요한 경우 나중에 수정할 수 있도록 코드를 문서화했습니다. 또한 166 페이지의 Photoshop JS 참조 설명서를 확인하여 선택 사항에 대해 자세히 알아보십시오. 깃털, 확장/교차 등을 설정할 수 있습니다. 선택이 필요한 경우.

CS6 용으로 제작되었으므로 후자와 함께 사용해야합니다.

#target photoshop 
if (documents.length == 0) { 
    alert("nothing opened"); 
} else { 
    // start 

    //setup 
    var file = app.activeDocument; 
    var selec = file.selection; 

    //run 
    var bnds = selec.bounds; // get the bounds of current selection 
    var // save the particular pixel values 
     xLeft = bnds[0], 
     yTop = bnds[1], 
     xRight = bnds[2], 
     yBottom = bnds[3]; 

    var newRect = [ [xLeft,yTop], [xLeft,yBottom], [xRight,yBottom], [xRight,yTop] ]; // set coords for selection, counter-clockwise 

    selec.deselect; 
    selec.select(newRect); 

    // end 
} 
관련 문제