var myDocument = app.activeDocument; if (myDocument.selection[0] instanceof TextFrame) { var tf = myDocument.selection[0]; tf.textFramePreferences.verticalJustification = VerticalJustification.CENTER_ALIGN; } else { alert("対象テキストフレームを選択してください。"); }