but how can i move layers up or down vertically. and can you tell me how to write script for align them.. ?
Here's a script that will abut and center a group of layers. This script has no error checking, so you need to add that, if you want it. To use this script, you have to have all the layers you want centered and aligned in a group. You have to have that group selected when you run the script. The layers will be aligned by the order they are in the layer stack, so if you want to reorder the positions, you need to reorder the layers. You need to either create a UI to set the vertical height (in percent) or you need to edit the script and enter the value you want. You could also modify the script so that it aligns all the layers to the first layer. Right now it will align the layers at 20% of the documents height.
#target photoshop
var doc = activeDocument;
app.preferences.rulerUnits = Units.PIXELS;
var vertPos = 20;// percent location top of layers to top of document
var layerArray = new Array();
var layersTotalWidth = 0;
var layerGp = doc.activeLayer;
var docCenter = doc.width/2;
for(var i=0;i<layerGp.layers.length;i++){
layerArray.push(layerGp.layers);
layersTotalWidth+=layerArray.bounds[2]-layerArray.bounds[0]
};
var moveTo = docCenter-layersTotalWidth/2;
for(var i=0;i<layerGp.layers.length;i++){
var curLayer = doc.activeLayer= layerGp.layers;
curLayer.translate (moveTo-curLayer.bounds[0], doc.height*(vertPos/100)-curLayer.bounds[1]);
moveTo = curLayer.bounds[2]
}