Copy link to clipboard
Copied
Hello Scripters,
in my Indesign document I have anchored objects as sidenotes, sometimes they're overlapping.
For this I am trying to move them as long as they still overlap, I used the following script:
myInlineRectangles
I've put that line into a while loop to move the object (until it doesn't overlap).
It does work, it moves the object (although I read that this is not possible). The only problem is that the geometricBounds stay the same.
As I am comparing the geometricBounds in my "while-condition" it ends in an endless loop.
Why does the object doesn't change its geometricBounds after moving?
How to avoid that?
Thanks a lot in advance for any answer.
Franzi_ska
Hi franzi_ska,
You'll need to tell the story containing the anchored object to recompose to get the new geometric bounds (after each move, and assuming that the anchored object can, in fact, move).
Thanks,
Ole
Copy link to clipboard
Copied
Maybe the anchored object cannot move no more beyond a specific position (and reaches this position before the loop-end condition satisfied).
For instance, if you have anchoredObjectSetting.pinPosition set to true and moves iteratively the object along the y-axis, you will reach a point where move(undefined, [0, -2]) has no more effect, resulting in invariant geometricBounds.
Maybe...
@+
Marc
Copy link to clipboard
Copied
hello marc,
thanks for your answer.
In my anchoredObjectSettings I only set the Option Keep Within Top/Bottom Column Boundaries (as true).
That's why the object is moved until a certain point and then the movement has no effect.
In fact the object is moved and the overlapping is compensated many times.
if I have look into the indesign document while running the script, the object in fact moves.
for this i don't see a reason why the geometricbounds do not change because of this?
thanks.
franzi_ska
Copy link to clipboard
Copied
Hi franzi_ska,
You'll need to tell the story containing the anchored object to recompose to get the new geometric bounds (after each move, and assuming that the anchored object can, in fact, move).
Thanks,
Ole
Copy link to clipboard
Copied
Hi Ole,
I tried what you suggested and it works!
Thanks a lot for that!
Regards, franzi
Copy link to clipboard
Copied
Hi Ole,
I tried what you suggested and it works!
Thanks a lot for that!
Regards, franzi