you need to set a place point with an array of two values instead of setting geometric bounds with an array of four values - like you did:
var myStory = myIndex.generate(myIndexPage, [myY1, myX1], myLayer, true, true);
This generates a new index story.
Afterwards you can do something with the textContainers of the new index stories (e.g. specify their geometric bounds).
it works, thank you very much!
I am trying to place the index on the last page and autoflow it.
What's happening is that it always places the index textFrame on the right page (also if there is no right page).
How to avoid this?
Thanks in advance!
Are you using spread, spine or page rulers? If you're using spread or spine coordinates then that's why the index is appearing on the right page because those coordinates point there.
in my script I am doing this:
var myIndexPage = myDocument.pages.add(LocationOptions.AT_END);
after defining the index paramter:
myIndex.generate(myIndexPage, [myTypeAreaHeight, myTypeAreaWidth], myLayer, false, true);
var myIndexFrame = myDocument.textFrames.lastItem();
myIndexFrame.geometricBounds = myGetBounds (myDocument, myDocument.pages.lastItem());
I am also wondering why the TextFrame does not take the full height of my TypeArea and always is placed in the middle of the page and not at the beginning.
Thanks in advance for any help.
I just found the problem.
There must be something wrong with the measurement units.
I entered the values like that [20, 20] - which should be the x, y coordinates of the left upper corner.
With those values it works - but in real the values are [20, 40] - where could these discrepancies come from?
(it is important to know to set those values dynamically from the typearea).
I am using an Indesign-Template - so I think the units must be right...