大きさとか位置とかまとめて変えたいときに。
//左上基準で大きさ合わせる app.doScript (main, ScriptLanguage.JAVASCRIPT, [], UndoModes.FAST_ENTIRE_SCRIPT); function main (){ var sel=app.activeDocument.selection; for(var i=1; i<sel.length; i++){ var GB1=sel[0].geometricBounds;//1個目の座標 var W=GB1[3]-GB1[1];//幅 var H=GB1[2]-GB1[0];//高さ var GB2=sel[i].geometricBounds; sel[i].geometricBounds=[GB2[0],GB2[1],GB2[0]+H,GB2[1]+W]; } }
//天に合わせる app.doScript (main, ScriptLanguage.JAVASCRIPT, [], UndoModes.FAST_ENTIRE_SCRIPT); function main (){ var sel=app.activeDocument.selection; for(var i=1; i<sel.length; i++){ var GB1=sel[0].geometricBounds; var GB2=sel[i].geometricBounds; sel[i].geometricBounds=[GB1[0],GB2[1],GB2[2],GB2[3]]; } }
//底に合わせる app.doScript (main, ScriptLanguage.JAVASCRIPT, [], UndoModes.FAST_ENTIRE_SCRIPT); function main (){ var sel=app.activeDocument.selection; for(var i=1; i<sel.length; i++){ var GB1=sel[0].geometricBounds; var GB2=sel[i].geometricBounds; sel[i].geometricBounds=[GB2[0],GB2[1],GB1[2],GB2[3]]; } }
//右に合わせる app.doScript (main, ScriptLanguage.JAVASCRIPT, [], UndoModes.FAST_ENTIRE_SCRIPT); function main (){ var sel=app.activeDocument.selection; for(var i=1; i<sel.length; i++){ var GB1=sel[0].geometricBounds; var GB2=sel[i].geometricBounds; sel[i].geometricBounds=[GB2[0],GB2[1],GB2[2],GB1[3]]; } }
//左に合わせる app.doScript (main, ScriptLanguage.JAVASCRIPT, [], UndoModes.FAST_ENTIRE_SCRIPT); function main (){ var sel=app.activeDocument.selection; for(var i=1; i<sel.length; i++){ var GB1=sel[0].geometricBounds; var GB2=sel[i].geometricBounds; sel[i].geometricBounds=[GB2[0],GB1[1],GB2[2],GB2[3]]; } }