Positioning a clipping mask with contents
var item = doc.pageItems[i];
var itemWidth = item.width;
var newX = (docWidth - itemWidth) / 2;
var newY = 0;
item.position = [newX, newY];
When the items are simple shapes the above script works as expected i.e. the top border aligned at top artboard side. In case the items are cplipping mask with contents which is higher than the mask then the script fails i.e. the top artbord side aligned with top mask contents. What is possible to do to fix it? I expect that the clipping mask top border will be aligned at the artboard's top side.
