Change position of layer to top left of the art board using script
Hi guys, i just want to ask how to change the position of the layer to top left in the art board using script. I have a code here that i found through searching but it will only change the position to the center of the art board and i tried changing it to make the position to top left but i cant seem to make it right. can you guys please help me. it would be a huge help, The code is below.
with (docRef) {
rulerOrigin = [0,0];
var docVB = visibleBounds;
var transX = (width / 2) - ((docVB[0] + docVB[2]) / 2);
var transY = (height / 2) - ((docVB[1] + docVB[3]) / 2);
for (var i = 0; i < layers.length; i++) {
for (var j = 0; j < layers.pageItems.length;j++) {
layers.pageItems
}
}
}
