Hello everybody.
I have a situation where I have to data-merge many text files to the one actual indesign "base" file. The formats of the databases are all the same, the point of difference is a code in the second field of the database that refers to a mailing zone (not a zip/postcode, a "distribution centre" code that has 56 or so possibilities). I would prefer to data merge one file and then somehow split the resulting PDF via Acrobat, but the length of the resulting mailing zones is inconsistent and something that can't be done though the "split document" feature in acrobat.
The database starts out as one massive file but using a one-line code, can be split into its mailing zones into separate text files.
My ultimate question: is there any way to data merge more than one file at once (e.g. one after another) and give them their names based on the names of the input text file?
Ole Kvern had a script to Data Merge one file without the UI. I have altered the last line slightly so that it outputs to a PDF based on [High Quality Setting]:
if(app.documents.length != 0){ var myDocument = app.activeDocument; app.dataMergeOptions.removeBlankLines = true; //Select a source file. var myDataFile = File.openDialog("Select a data file") var exported = "file location(redacted for the sake of this post)" if(myDataFile != ""){ myDocument.dataMergeProperties.selectDataSource(myDataFile,); myDocument.dataMergeProperties.exportFile(exported,"[High Quality Print]",); } }
I figure the answer has to do with the variable "myDataFile" and rather than being simply open a dialog, it would be somehow selecting an array of text files, but this is where I am out of my depth.
Any insights or other thoughts that may not involve trying to do many merges at once but may somehow revolve around one large merged PDF?
Many thanks
Colin