I've now figured out automating the export to PDF.
Next is trying to name all these PDF's appropriately based off the data being merged.
A colleague of mine ended up creating a custom python script. Using that python script and the batch_convert.jsxbin InDesign script we're now able to automatically generate each PDF (even multiple pages per PDF), uniquely named based on the CSV data.
Our python script and an example is available here.
The batch_convert.jsxbin script is available here.
This will take all the IDMLs generated from the python script and then automatically convert them into PDFs.
1. Verify python file has the right IDML path and CSV path.
2. Open Terminal and ‘cd' to the directory containing the IDML, CSV, and python script.
3. In Terminal, enter 'python3 batch_idml_editor.py' (success = Terminal prints out each patient file, failure = Terminal displays error).
3. Open InDesign with no open files.
4. In InDesign, run script ‘batch_convert.jsxbin'
5. From the batch_convert.jsxbin popup, select your ‘Input Folder'. This will be the folder generated by your python script from step 3. It’ll look like ‘outputXXXXXXX’.
6. From the batch_convert.jsxbin popup, select your 'Output Folder'. This is the directory where you want the PDFs to be placed. Pick anything that makes sense.
7. From the batch_convert.jsxbin popup, select ‘Source Format’ = ‘IDML’.
8. From the batch_convert.jsxbin popup, click ‘OK’ button. This will generate all the PDFs and should be complete within a few minutes.