Answered
Position of object
I have two basic rectangles.
How can I (with jsx) compare their coordinates and determine which one is more to the left (has a lower X coordinate value)? and put the message in alert

I have two basic rectangles.
How can I (with jsx) compare their coordinates and determine which one is more to the left (has a lower X coordinate value)? and put the message in alert

You can access the left and top properties of PageItem. So...
var item1 = selection[0];
var item2 = selection[1];
var leftmost;
if (item1.left < item2.left) {
leftmost = 'item1';
} else {
leftmost = 'item2';
}
alert(leftmost + ' is leftmost\nitem1.left = ' + item1.left + '\nitem2.left = ' + item2.left);
Also of interest might be: position and geometricBounds.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.