Adding objects relativly to the previous object
Dear all,
I want to generate 20 objects (the grey ones) with a specific gap in between them and starting relativ to an already present object (the "FoFe" field):

I'm able to generate those 20 objects but I'm out of ideas to move them below each other.
My code:
var myMasterSpread = myDocument.masterSpreads.item(0);
var TF_FoFe = myMasterSpread.textFrames.add({
geometricBounds: [60,36,74,60] /*size of Text box*/,
contents: "FoFe" /*what is written in the text box*/
}); // end of description of text box
var myPara2 = TF_FoFe.paragraphs[0];
myPara2.properties = {
appliedFont: app.fonts.item("Arial"), // which font is used
fontStyle: "Bold", // bold or regular or italic
pointSize: 10, // which font size is used
justification: Justification.centerAlign // should the text be left, center or right aligned
}; // end of description of second TextBox
for (var a = 0; a < 20; a++) {
var myY1 = 82;
var myX1 = 36;
var myY2 = 96;
var myX2 = 60;
var myGap = 8;
var myTf = myMasterSpread.textFrames.add({
geometricBounds: [myY1, myX1, myY2, myX2],
LocationOptions: LocationOptions.AFTER,
reference: PageItem.PreviousItem
});
}
The PreviousItem thing doesn't work, I'm missing the thing, that it takes into account the objects it created by itself.
Do you have any ideas? I become desperate...
Best
Cleo