0 Replies Latest reply on Apr 22, 2017 4:02 PM by veerr28307328

    Batch Data Merge Script to export JPEG files Directly From CSV Not From Merged Doc

    veerr28307328

      What i am doing is

      - Use csv to Data merge and then export the JPG from merged data.

       

       

      Limitation of this is

      - After 10 thousand Row my Indesign crash if i try to datamerge a big CSV FILE.

      - Without data merge i can not export.

       

       

      I use this script to export the PDF directly without doing data merge.  (See Code no.1 In Bottom)

      http://www.kahrel.plus.com/indesign/batch_convert.html

      along with this script joined

      https://forums.adobe.com/thread/1891948

       

       

      But there is limitation, I can not export JPG (but can do PDF) directly without creating merged document.

       

       

      I want You to write a script which can either

       

       

      - Do data merge in batch (data merge 500 rows of the csv and then then export directly)

      OR

      - Do not data merge Just directly export from csv (just like this pdf export script)

      OR

      (following is possible in PDF case - See Code Number 2 in Bottom)

      - The script which pickup csv + indesign document data merge it in batch and export image in a specified folder where image names are from a column of csv.

      for example

      Document Banana.indd

      picks data from

      banana.csv

       

       

      I checked the following links too. They work only on merged Document.

      Gilbert Consulting - Software training and consulting - InDesign, InCopy, Photoshop, Illustrator, Acrobat, Flash, Quark  ****

      Gilbert Consulting - Software training and consulting - InDesign, InCopy, Photoshop, Illustrator, Acrobat, Flash, Quark  ****

      **** Please note that script in these websites Only work for Merged Document not Direct CSV Input.

       

       

       

       

       

       

      .

      #################### Script Code No. 1 - Used with http://www.kahrel.plus.com/indesign/batch_convert.html ###########

       

       

      if(app.documents.length != 0){  
              var myDoc = app.activeDocument;  
              app.dataMergeOptions.removeBlankLines = true;  
              var myDataFile = File.openDialog("Select a data file")  
              var myLocation = "E:/111/"
              var myName = myDoc.name  
              var myExport = myLocation + myName +".jpg"
              if(myDataFile != ""){  
                      myDoc.dataMergeProperties.selectDataSource(myDataFile,);  
                      myDoc.dataMergeProperties.exportFile(myExport, ExportFormat.JPG, ); 
                      
              }  
        
      } 
      

      ########################################################################################## #########################

       

       

       

       

      ################# Script code no. 2 for picking data from same name csv############################################

       

       

       

       

      if(app.documents.length != 0){
              var myDoc = app.activeDocument;
              var myName = myDoc.name
              var myLocation = "YOURFOLDERHERE"
              var myExport = myLocation + myName + ".pdf"
              var myImport = myLocation + myName + ".txt"
              var myDataFile = myImport
              app.dataMergeOptions.removeBlankLines = true;
              if(myDataFile != ""){
                      myDoc.dataMergeProperties.selectDataSource(myDataFile,);
                      myDoc.dataMergeProperties.exportFile(myExport, "[High Quality Print]", );
              }
      }