5 Replies Latest reply on Aug 29, 2014 11:03 AM by BEGINNER_X

    Script for Image placement -not working

    Math Kay Level 1

      Hi,

      I want to replace Figure callouts with the images. In text, callouts are <<Figure 1.1>>, ...... This script is showing error while running. Images are Figure 1.1.eps, ............

      Please resolve this.

       

      var myDoc=app.activeDocument;
      var myFilePath=myDoc.filePath;
      var linksPath=file(myFilePath+"/"+"links");
      //finding Figure Callouts//
      app.findGrepPreferences=app.changeGrepPreferences=null;
      app.findGrepPreferences.findWhat=<.+?Figure\\d+.\\d+>.+?;
      var myFound=app.activeDocument.findGrep();
      //clearing unwanted text in Fig call out name//
      for (i=0; i<myFound.length; i++){
          myContents=myFound[i].contents;
          myReplace=string(myFound[i].contents.replace(/<</, " ").replace(/>>/, " ");
          for(k=0; k<links.length; K++){
              var linksName=links[k].contents;
              var myFinalLinkName=links[k].name.split(".eps");
              if (myReplace==myFinalLinkName){
                  myReplace.insertionPoints[0].place[myFileName]
                  }
              }
          }