Alinhamento pelo centro na vertical
Hi
In the code below the object of the chamber "Cameron Right" shifts vertically but does not center on the artboart. What's wrong ?
// Get the active document
var doc = app.activeDocument;
// Get the "Cameron Direito" layer
var layer = doc.layers.getByName("Cameron Direito");
// Get the first item in the layer
var item = layer.pageItems[0];
// Get the bounds of the artboard
var artboardBounds = doc.artboards[0].artboardRect;
// Calculate the center of the artboard
var centerY = (artboardBounds[3] - artboardBounds[1]) / 2 + artboardBounds[1];
// Position the item at the center of the artboard
item.position = [item.position[0], centerY];
