2 Replies Latest reply on May 27, 2009 2:23 AM by triveni_dh

    Data Merge Don't Create Copy/New Document

      I modified a script that performs a Data Merge. Everything works great, but it creates a new document (which is inherently what happens if you Data Merge manually). Is there anyway to not create a new document?

      This is what I am using:

      var selectDataSource = "Data Merge: *.txt";
      var myDataSource = File.openDialog("Select Data Source");
      app.activeDocument.dataMergeProperties.selectDataSource(myDataSource);
      app.activeDocument.dataMergeProperties.mergeRecords();

      Thanks for any help.
        • 1. Re: Data Merge Don't Create Copy/New Document
          ravishar_30

          Hi,

           

          I have code for DataMerge It works fine , but it creates a new document (which is inherently what happens if you Data Merge manually). Is there anyway to not create a new document?Can anybody give javascript code to make Preview checkbox on Data Merge palette checked.

           

          This is what I am using:

           

          var selectDataSource = "Data Merge: *.txt";
          var myDataSource = File.openDialog("Select Data Source");
          app.activeDocument.dataMergeProperties.selectDataSource(myDataSource);
          app.activeDocument.dataMergeProperties.mergeRecords();

           

          Thanks for any help.

          • 2. Data Merge Don't Create Copy/New Document
            triveni_dh

            Hi,

             

            The given script creates a new Indesign document,which contains a range of records based on the data of a source.

            var mydoc = app.documents.item(0);
            var myone = mydoc.dataMergeProperties.updateDataSource();
            var MergeDoc = mydoc.dataMergeProperties;

            mydoc.dataMergeProperties.mergeRecords();

             

            Is it possible not to create a new document after data merge and data should flow in the existing document.

             

            Thanks for any help.