Copy link to clipboard
Copied
var r = app.activeDocument.rectangles.add({geometricBounds[".5in",".25in","2.5in","1.25in"]});
When I run this it's placing the item at X: 0.2431in, Y: 1.4931in. Can anyone confirm they get the same behaviour? And if you're in the know, could someone explain to me how something so unambiguous as 4 geometric points is being interpreted so strangely?
Copy link to clipboard
Copied
Hi @kurtis_7676 in the parameter for Rectangles.add you've omitted the colon after "geometricBounds" so it is probably using whatever default bounds are.
- Mark
Copy link to clipboard
Copied
How do you check those values?
What are the params for the stroke?
Can you post a screenshot of this item and what is InDesign showing in the Control Panel?
Copy link to clipboard
Copied
Not necessary - thanks for jumping in. To answe though, for example it was showing the X: value as '1.2431' if I set it in 1.25. It's an alignment setting I wasn't aware of (the story of my InDesign scripting life).
Copy link to clipboard
Copied
I got the issue. Sorry folks my script wasn't actually accurate - I was missing a color. But even with the colon it persisted. The issue was that it's aligning to the stroke - so the .0069 inches out was because the stroke is 1pt, therefore it's offsetting by half, to center the stroke on the origin point.
Thanks for trying!
Copy link to clipboard
Copied
That was my point - screenshot would show the stroke and the mismatch.
Copy link to clipboard
Copied
OK?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now