0
Photoshop拡張スクリプトで、不規則な選択(マジックワンドツール選択など)を選択の左上、右下、および右端を含む長方形の選択肢に変換することができるかどうかは誰にも分かりますか?Adobe Photoshop Scripting - 現在の選択範囲の境界ボックスを選択する方法
Photoshop拡張スクリプトで、不規則な選択(マジックワンドツール選択など)を選択の左上、右下、および右端を含む長方形の選択肢に変換することができるかどうかは誰にも分かりますか?Adobe Photoshop Scripting - 現在の選択範囲の境界ボックスを選択する方法
ここでは、コードを文書化して、必要に応じて後で変更できるようにしています。また、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
}
それが自分のレイヤーにある場合のみ。 –