InDesign CS4自動化作戦 (InDesign CS4 Automation Operation)

チェックボックスを追加する

■プログラム説明(ソースコード説明)
 ダイアログ内にチェックボックスを表示するには、まずダイアログを作成した後に、dialogColumns.add()とします。次にcheckboxControls.add()でチェックボックスを追加します。staticLabelで表示する項目を設定します。幅はminWidthで指定できます。その際指定する単位はピクセルになります。最初から特定のチェックボックスを選択しておくにはcheckedState:trueを指定しておきます。

■ソースコード
wObj = app.dialogs.add({ name:"Sample" });
tmp1 = wObj.dialogColumns.add();
tmp3_1 = tmp1.checkboxControls.add({staticLabel: "選択肢1", minWidth:120});
tmp3_2 = tmp1.checkboxControls.add({staticLabel: "選択肢2", minWidth:120});
tmp3_3 = tmp1.checkboxControls.add({staticLabel: "選択肢3", minWidth:120, checkedState:true});
wObj.show();


■使い方
1:スクリプトを実行します。
2:チェックボックスが表示されます。


■ポイント
 なし

■実際のスクリプトをダウンロード(sample.jsx.zip)

写真素材 PIXTA