2 Replies Latest reply on Oct 27, 2013 11:35 PM by banl_05

    Find text and place eps images

    banl_05 Level 1

      Hi,

       

      I have lot of eps images in folder (eps001.eps,eps002.eps) but manually find text in indesign [[[eps001.eps]]] and place coresponding image folder any one can help me

       

      Regards,

      Balaji

        • 1. Re: Find text and place eps images
          Sajeev Sridharan Level 4

          Try this,

           

          var myArtFolder = File("/C//figures/");//figure folder path

          var myArtFilesList = myArtFolder.getFiles();

           

          app.findGrepPreferences = app.changeGrepPreferences = null;

          app.findGrepPreferences.findWhat = '\\[\\[\\[.+\\]\\]\\]';

          found = app.activeDocument.findGrep (true);

          for (j = 0; j < found.length; j++){

              var foundText = found[j].contents;

              for(i=0;i<myArtFilesList.length;i++)

              {

                  var artFile = '[[[' + myArtFilesList[i].name + ']]]'

                  if(artFile==foundText)

                  {

                      found[j].insertionPoints.item(0).place(File (myArtFilesList[i]));

                  }

              }

          }

          app.findGrepPreferences = app.changeGrepPreferences = null;

           

          I didnt remove the text "[[[eps001.eps]]]..." using script, you test it and  finally remove it using grep.

           

           

          Vandy

          • 2. Re: Find text and place eps images
            banl_05 Level 1

            Hi vandy

             

            Thank you so much. Its work fine.

             

            Balaji