[InDesign JavaScript] 選択しているアイテムを整列させる(オブジェクトの整列 編)
例(上揃え、選択範囲に揃える)
app.activeDocument.align(app.activeDocument.selection,AlignOptions.TOP_EDGES,AlignDistributeBounds.ITEM_BOUNDS,false);
align(
ItemObject,
AlignOptions
[,
AlignDistributeBounds,
useDistributeMeasurement,
absoluteDistributeMeasurement
]
)
[AlignOptions]
AlignOptions.BOTTOM_EDGES //下端揃え
AlignOptions.HORIZONTAL_CENTERS //水平方向中央揃え
AlignOptions.LEFT_EDGES //左端揃え
AlignOptions.RIGHT_EDGES //右端揃え
AlignOptions.TOP_EDGES //上端揃え
AlignOptions.VERTICAL_CENTERS //垂直方向中央揃え
[AlignDistributeBounds]
AlignDistributeBounds.ITEM_BOUNDS //選択範囲に揃える
AlignDistributeBounds.MARGIN_BOUNDS //マージンに揃える
AlignDistributeBounds.PAGE_BOUNDS //ページに揃える
AlignDistributeBounds.SPREAD_BOUNDS //スプレッドに揃える
[useDistributeMeasurement]
true //間隔指定を使う
false //間隔指定を使わない
[absoluteDistributeMeasurement]
間隔指定の数値
※3つ目以降のオプションは無くても動きます。無い場合は現在パレット上で選択されているオプションで動作します。