var dp=new DocumentPreset(); dp.artboardLayout=DocumentArtboardLayout.RLGridByRow; dp.numArtboards=7; dp.artboardRowsOrCols=2; var myDoc=app.documents.addDocument("", dp);