Hi Hasvi,
Try this.
var path = Folder.selectDialog ("Select folder");
var files = path.getFiles("*.indd");
for(var i =0;i<files.length;i++)
{
var doc = app.open(files[i],false)
var myLpage = doc.pages[-1].pageItems.everyItem();
//doc.align(myLpage, AlignOptions.VERTICAL_CENTERS, AlignDistributeBounds.MARGIN_BOUNDS);
doc.align(myLpage, AlignOptions.HORIZONTAL_CENTERS, AlignDistributeBounds.MARGIN_BOUNDS);
doc.save();
doc.close();
}
Regards,
Chinna