Reply To: Create batch of new documents

Home Page / Forums / InDesign User Groups / Create batch of new documents / Reply To: Create batch of new documents

#86365
Ari Singer
Member

My posts are not going through, so I’ll try one more time:

var file = File.openDialog("Select Your Text File", undefined, false);
var folder = Folder.selectDialog("Select the folder where the new documents should be saved");
file.open("r");
var content = file.read().split("");

for (var i = 0; i < content.length - 1; i++) {
    var curLine = content[i].split("");
    var h = curLine[0];
    var w = curLine[1];
    docName = h + " x " + w;
    try {
        var newDoc = app.documents.add(false);
        newDoc.documentPreferences.pageHeight = h;
        newDoc.documentPreferences.pageWidth = w;
        newDoc.save(new File(folder + "/" + docName + " .indd"));
        newDoc.close(SaveOptions.no)
        } catch(myError){}
    }

This article was last modified on July 8, 2016

Comments (0)

Loading comments...