1 Reply Latest reply on Dec 23, 2014 11:24 PM by Chinnadk

    Font change

    Level 1

      Hi All

       

      How to replace one applied font to another  via scripting for multiple files

       

      I need to replace the Mathematical Pi LT Std font to Times New Roman

       

      Please help me to solve this

        • 1. Re: Font change
          Chinnadk Level 4

          Try this,

           

          var _folder = Folder.selectDialog("Select the path...", ""),
              _files = _folder.getFiles("*.indd");
          for(var i =0;i<_files.length;i++)
          {
                  var doc = app.open(_files[i]);
                  app.findTextPreferences = app.changeGrepPreferences = null;
                  app.findTextPreferences.appliedFont = "Mathematical Pi LT Std";
                  app.changeTextPreferences.appliedFont = "Times New Roman";
                  doc.changeText();
                  app.findTextPreferences = app.changeGrepPreferences = null;
                  doc.save();
                  doc.close();
              }
          

           

          Regards,

          Chinna