2017-04-19 4 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 
} 
関連する問題