1 Reply Latest reply on May 13, 2018 8:52 AM by Loic.Aigon

    Replace .eps into .JPEG

    VeluVK Level 1

      Hi,

       

      I need to replace all .eps files into .JPEG using script. i have tried the below script, it is not getting any output. Can anyone help this

       

      Purpose:

       

      While exporting InDesign into RTF, .eps are missed out, so i need to replace .eps into JPEG files.

      File name for both JPEG and .eps are the same and available in the same path.

       

       

      var myFilteredFiles = new Array;

      var myFolder;

      startDate = new Date();

       

       

       

       

      var myGFolder = Folder.selectDialog("New path for the JPG Images")+"";

      app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;

          for (var myFileCounter = 0; myFileCounter < myFilteredFiles.length; myFileCounter++)

          {

              var myFile = myFilteredFiles[myFileCounter];

              var myDoc = app.open(myFile);

              myDoc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;

              myDoc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;

              myDoc.viewPreferences.rulerOrigin = RulerOrigin.pageOrigin;

              myDoc.zeroPoint = [0, 0];

       

       

      //function replaceJpgImages(myGFolder)

      //{

      var myDoc = app.documents[0];

      var newSuffix="jpg";

      //~ var myFolder = Folder.selectDialog("New path for the JPG Images")+"";

      myLinks = myDoc.links;

      for (oneLink=myLinks.length-1;oneLink>-1;oneLink--) {

      myLink = myLinks[oneLink];

      myString = myLink.name.split(".");

      myName = myString[0] + ".jpg";

       

       

      myNewLink = File(myGFolder + "/" + myName);

      try{

      myLink.relink(myNewLink);

      myLink.update();

      }

      catch(e){}

      }

       

       

         

          }

       

      Regards,

      Velu