1 Reply Latest reply on Nov 13, 2015 6:14 AM by alahala

    Data merge and print script


      Hi all,


      Wonder if people could make some suggestions or lend some advice.


      I have a job which is normally a load of csv files which are merged into a template and indesign and printed.


      so i have to


      1. select date source

      2. create merged doc

      3. print

      4. move onto next csv..and repeat


      Because of the nature of the job i can't merge the csv files into one.


      Could i automate this?


      With thanks as ever.

        • 1. Re: Data merge and print script


          I guess you need to employ script outside InDesign environment. I use Autohotkey a lot, and it is quite powerful. Creating script can be very simple or very complicated either, depending on your knowledge.

          The way I used that thing for something similar to your task is creating script for pressing physical keyboard keys. You may assign keyboard shortkeys in InDesign for changing Source file and make Autohotkey press needed keystrokes for different files in the row. Or use the AutoScriptWriter (Recorder) to see the mouse clicks coordinates, which is not preferable for me, since windows positions and sizes varies.

          Here is a small example of code where Shift+F4 is my assigned shortkey for performing Merge and "; " stands for "comment" line:


          ; Perform Data Merge

          Send, {SHIFTDOWN}{F4}{SHIFTUP}

          Sleep, 250

          Send, {ENTER}

          WinWait, Creating Merged Document,

          IfWinNotActive, Creating Merged Document, , WinActivate, Creating Merged Document,

          WinWaitActive, Creating Merged Document,


          Sleep, 350

          Send, {ENTER}


          As you may see, it's quite straightforward and simple.

          Hope this is helpful.