app.beginUndoGroup("位置を変えずに揃える");
lay = app.project.activeItem.selectedLayers;
var myComp = app.project.activeItem;
for (i=0; i
右揃えにする場合
揃えの種類を変更します。
var just = ParagraphJustification.LEFT_JUSTIFY; //左揃え
var just = ParagraphJustification.RIGHT_JUSTIFY;//右揃え
var just = ParagraphJustification.CENTER_JUSTIFY; //中央揃え
位置を変えずに右揃えにする場合:
//中央揃え▶右揃え
if (beforeJust == justCenter) {
var rectL = myTextLayer.sourceRectAtTime(0, false).left;
myTextLayer.property("ADBE Transform Group").property("ADBE Position").setValue([posX - rectL / 2, posY]);
}
//左揃え▶右揃え
if (beforeJust == justLeft) {
var rectL = myTextLayer.sourceRectAtTime(0, false).left;
myTextLayer.property("ADBE Transform Group").property("ADBE Position").setValue([posX - rectL, posY]);
}
左揃えにする場合
//中央揃え▶左揃え
if (beforeJust == justCenter) {
var rectL = myTextLayer.sourceRectAtTime(0, false).left;
myTextLayer.property("ADBE Transform Group").property("ADBE Position").setValue([posX + rectL, posY]);
}
//右揃え▶左揃え
if (beforeJust == justRight) {
var rectL = myTextLayer.sourceRectAtTime(0, false).left;
myTextLayer.property("ADBE Transform Group").property("ADBE Position").setValue([posX + rectL, posY]);
}