16 Replies Latest reply on Apr 7, 2008 10:02 PM by (sunilkumarrajup)

    Data Merge Scripting Problem

      Hi experts. I need some help automating data merge with ID CS3.

      I have a 30 page ID book template. It is a personalized children's book that has a child's picture and name throughout the book. Currently this is my manual data merge process:
      1) I Set up 1 source text file with 1 row (name and filepath to image)
      2) I Data merge to create the book
      3) I export to pdf: BOOK 1 IS DONE - NOW TO DO THE SAME FOR BOOK 2
      4) I update the text file with book 2 name and filepath and save
      5) Then I open my template and data merge to create book 2
      6) ect, etc.

      I want to be able use an automation script to data merge the first line of the source text file to a template, export to the ID file to PDF, close the completed ID file, open the ID template again, data merge line 2 from the text file. ect.


      I could data merge the entire source file, creating 1 huge ID file (ie. a 100 book ID file), then use a script that will split the file into 1 book pdfs. (this method I believe would crash ID, due to memory issues)

      Any suggestions...

      Thanks so much for any help. You have no ides how much time this would save!
        • 1. Re: Data Merge Scripting Problem
          Hi Eric.

          I dont know if you are still looking into this issue, but I have written a script to do the same thing (but with many more fields) for a company called UStar. www.ustarnovels.com The appoach I took was to have a csv file for each book, have an InDesign file with variable placeholders ie [Q1], [Q2] etc. I would then open the csv, strip out the fields, do a search/replace, and print to the online digital printer. Printing to a PDF file in the same way.

          I have just started a new job, so would not be able to assist to involvede at the moment, but would gladly help with some advice if needed.

          It is totally possible to do, just may take a bit of time and effort

          Take Care

          • 2. Re: Data Merge Scripting Problem
            Level 1
            Thanks Roy, I've gotten half way there.

            i realized that I can limit the data merge to 1 record per document. So when I do the data merge, if I have 100 records in the text file, it creates 100 indd files. The problem is that after each book is created, the file remains open. So in this scenario I have 100 open indd files that I have to manually save. Then I found a javascript online that will batch export all my indd files in a specified folder to PDF. Still painful, but better.

            Since you offered, I will ask a question:

            this isn't the scenario, but it represents the same concept: Let's say I have a text file with 1 column, NAME, and 2 records, JOHN and SALLY. I run data merge on my template and now have a book for john and a book for sally, both open in ID. Can I run a script that will save the books as John.indd and Sally.indd?

            If so all I would need to do for 100 books is drop in a unique identifier for each book when data merging, then use that indentifier along with a script to batch-save all 100 files.

            Thanks, Sir!
            • 3. Re: Data Merge Scripting Problem
              Level 1
              Hi Eric

              The way I do my books is not using the built in mail merge facility, but built my own. Therefore, I am not limited to 1 text file for each merge, I can have 1 CSV file with multiple columns, and iterate down the list. Also the way I work is directly in the production line, so as soon as my inDesign file is occupied, it is instantly sent to the printer, using print presets withing the script. Therefore, I simply dont have and intermediate files. In your case, you are looking to save the file with the variable name which is totally possible.
              I would suggest opening a new topic with this title, as I am not in a position to look totally into it, and it will escalate back to the top of the forum.
              As you are using the mailmerge engine built in, I am not sure how or if the name is actually available as a variable for you to use though.

              If it was me, I would build my own JS to deal with all the process, including producing a log file of what has been produced etc... You will have total control over all the workflow that way.

              Sorry I cant help with specifics at the moment, but as I said, I have taken a new job, in a new country so am unable to spend extra time... at the moment. There are some VERY good guys here though who have helped me in the past, who I am sure will assist you.

              Take CAre

              • 4. Re: Data Merge Scripting Problem
                Hi Eric,

                I would agree with Roy that it might be worth your while to build your own system that holds your source data and logic and can drive InDesign. I use FileMaker Pro for this purpose with both Quark and InDesign. In FileMaker I store records which contain the variable data to be used in the customization of an InDesign document. I make a calculated text field which assembles all the Applescript needed to produce one version of the document. I make a second calculated field which simply equals the first calculated field (this seems redundant, but do it). I make a FileMaker script which contains only the Send Event script step. This step targets an InDesign or Quark document and fires the content of my second calculated field at it as Applescript. When I get this first FileMaker script working to create one InDesign document from one FileMaker record I move on to create a second FileMaker script that has a loop. It simply goes to the first record, calls my first script and moves to the next record, etc, etc. till all the records are done.
                Pat Monks, Seattle, WA patmonks@mac.com
                • 5. Re: Data Merge Scripting Problem
                  hi my project is to merge the .csv data with .indd adn produce the .indd file atlast after merging using javascript can you please give me the script please
                  • 6. Re: Data Merge Scripting Problem

                    I was wondering if someone could help. I currently have an excel file (data for approximately 70 pages of indesign). I have custom templates made in indesign for each page.

                    A. Is there a way for Indesign CS3 to allow already designed templates to fill in the data and images?

                    B. If there is a plug in I need does anyone know which one? Is there anyone out there that can help me though this?
                    • 7. Re: Data Merge Scripting Problem
                      Level 1
                      hi every one i presently working on project that is to merge the data of .csv with .indd and produce new merged document as .indd ,anyone can help me ,and please show me the script .waiting for reply ..please its urgent for me understand my problem please.......please.......
                      • 8. Re: Data Merge Scripting Problem
                        Level 1
                        Hi Laura,

                        The Data Merge plug-in (Window>Automation>Data Merge) will do what you want. How complex a task this is depends on your data and your templates. Have you tried using the Data Merge plug-in with a tab or comma delimited version of your Excel data?


                        • 9. Re: Data Merge Scripting Problem
                          Level 1
                          Hi olav ,

                          thanks for helping me,sir i will clearly explain my project ,
                          1) first I will have .csv data ,and then I have to merge with .indd and after that I should covert it in to pdf document .all this process should done in single javascript.and I should run in the Adobe Indesign Cs3 Server. Iam running scripts in Adobe Extended Tool Kit.
                          Can you give script for my project.waiting for your reply.
                          • 10. Re: Data Merge Scripting Problem
                            Level 1
                            Eric A Hendrickson
                            hi iam sunil,i want some help,my project is to merge the .csv file which contains multiple records with .indd and produce a new merged document .indd using javscript,so please give me the javscript for my application,please it is urgent...
                            • 11. Re: Data Merge Scripting Problem
                              Level 1
                              <div class=Section1><br /><br /><p class=MsoNormal><font size=3 color=black face="Times New Roman"><span<br />style='font-size:12.0pt;color:black'>I don&#8217;t use javascript for merging<br />documents.  I just use the merge function within ID.  I have multiple records,<br />where each record goes to a different ID document.  I just set the merge<br />function to import 1 record per document.  The javascript I use is to batch export<br />all completed ID files in a folder to PDF.<o:p></o:p></span></font></p><br /><br /><p class=MsoNormal><font size=3 color=black face="Times New Roman"><span<br />style='font-size:12.0pt;color:black'><o:p> </o:p></span></font></p><br /><br /><p class=MsoNormal><font size=3 color=black face="Times New Roman"><span<br />style='font-size:12.0pt;color:black'>Sorry I wasn&#8217;t more help.<o:p></o:p></span></font></p><br /><br /><p class=MsoNormal><font size=3 color=black face="Times New Roman"><span<br />style='font-size:12.0pt;color:black'><o:p> </o:p></span></font></p><br /><br /><p class=MsoNormal><font size=3 color=black face="Times New Roman"><span<br />style='font-size:12.0pt;color:black'>Eric<o:p></o:p></span></font></p><br /><br /><p class=MsoNormal><font size=3 color=black face="Times New Roman"><span<br />style='font-size:12.0pt;color:black'><o:p> </o:p></span></font></p><br /><br /><div><br /><br /><div class=MsoNormal align=center style='text-align:center'><font size=3<br />face="Times New Roman"><span style='font-size:12.0pt'><br /><br /><hr size=2 width="100%" align=center tabindex=-1><br /><br /></span></font></div><br /><br /><p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;<br />font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2<br />face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> sunilkumarrajup<br />[mailto:member@adobeforums.com] <br><br /><b><span style='font-weight:bold'>Sent:</span></b> Tuesday, March 11, 2008 9:29<br />AM<br><br /><b><span style='font-weight:bold'>To:</span></b> adobe.scripting.indesign@adobeforums.com<br><br /><b><span style='font-weight:bold'>Subject:</span></b> Re: Data Merge Scripting<br />Problem</span></font><o:p></o:p></p><br /><br /></div><br /><br /><p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:<br />12.0pt'><o:p> </o:p></span></font></p><br /><br /><p class=MsoNormal style='margin-bottom:12.0pt'><font size=3<br />face="Times New Roman"><span style='font-size:12.0pt'>A new message was posted<br />by sunilkumarrajup in <br><br /><br><br /><b><span style='font-weight:bold'>InDesign Scripting</span></b> --<br><br />  Data Merge Scripting Problem<br><br /><br><br />Eric A Hendrickson <br><br />hi iam sunil,i want some help,my project is to merge the .csv file which contains<br />multiple records with .indd and produce a new merged document .indd using<br />javscript,so please give me the javscript for my application,please it is<br />urgent... <o:p></o:p></span></font></p><br /><br /><div class=MsoNormal><font size=3 face="Times New Roman"><span<br />style='font-size:12.0pt'><br /><br /><hr size=2 width=200 style='width:150.0pt' align=left><br /><br /></span></font></div><br /><br /><p class=MsoNormal style='margin-bottom:12.0pt'><font size=3<br />face="Times New Roman"><span style='font-size:12.0pt'>View/reply at <a<br />href="http://www.adobeforums.com/webx?13@@.3c05366e/9">Data Merge Scripting<br />Problem</a><br><br />Replies by email are OK.<br><br />Use the <a href="http://www.adobeforums.com/webx?280@@.3c05366e!folder=.eea52bc">unsubscribe</a><br />form to cancel your email subscription.<o:p></o:p></span></font></p><br /><br /></div>
                              • 12. Re: Data Merge Scripting Problem
                                Level 1
                                Hi Sunil

                                There is no way anyone in this forum can help you with your request, based on your post. In order to offer any sort of assistance, a whole lot of info is needed. Even then, it would be very difficult for anyone to give you a finished script without having your original CSV and INDD files. I have done exactly what you are needing, but will only work for my particular files and workflow. It would be as useful as an ice cream to an eskimo to anyone else.

                                Do you have any experience with scripting? If not, it would probably be worth asking a member here to freelance the job for you.

                                I hope this helps.

                                • 13. Re: Data Merge Scripting Problem
                                  Level 1
                                  hi,can any anybody tell me how to get multiple records per page using indeisng javascript,iam using tool called adobe extended tool kit.can anybody tell me please...

                                  actually iam using..

                                  Recordsperpage but iam unable to get multipl;e records per page..can you tell me how to get it.
                                  • 14. Re: Data Merge Scripting Problem
                                    Level 1
                                    I suggest reading the Javascript PDF files that you should have. There are some simple basic training steps that I think you may need to get through before you try to tackle this.
                                    Maybe after then, you will be able to ask a more direct question that can be answered.


                                    • 15. Re: Data Merge Scripting Problem
                                      Level 1
                                      thanks for reply,i have gone through the scripting tutorial,in that they are giving only two options they are (pagesperDocument,Recordsperpage)but iam giving these two but iam not getting.iam usning like this(RecordsPerPage.MULTIPLE_RECORD.but no use..so can anybody give me the idea hwo to do that,or we should need to do any changes in indeisgn document.waiting for your valuble replies.
                                      • 16. Re: Data Merge Scripting Problem
                                        Level 1
                                        hi,i want to merge .csv(Excel) data which consists of multiple Records(coloumns),with the .indd document using indesign javscript,but iam getting final document as multiple pages indd document,but i want to get all records in only single page .indd document.