Something like this should get you started: var document = app.documents.add(); var nrOfCircles = 100; var nrOfColumns = 10; var top = 40; var left = 40; var width = 20; var height = 20; var space = 5; for (var index = 0; index < nrOfCircles; index++) { if(index > 0 && index % nrOfColumns == 0) { // Reset left left = 40; // Start new row top += height + 5; } addCircle(index + 1, left, top, left + width, top + height); left+= width + space; } function addCircle(number, left, top, right, bottom) { var circle = document.ovals.add(); var textFrame = circle.textFrames.add(); var text = textFrame.texts.firstItem(); circle.geometricBounds = [top, left, bottom, right]; circle.strokeColor = document.swatches.itemByName("Black"); circle.strokeWeight = 2; textFrame.geometricBounds = [top, left, bottom, right]; text.pointSize = 12; text.justification = Justification.CENTER_ALIGN; textFrame.textFramePreferences.verticalJustification = VerticalJustification.CENTER_ALIGN; textFrame.contents = String(number); }
... View more