2 Replies Latest reply on Nov 4, 2016 7:11 AM by Obi-wan Kenobi

    Code to be evaluated! [005]

    Obi-wan Kenobi Adobe Community Professional

      Hi Scripters!

       

      This script seems to work fine but I'm not truly convinced by its code [ I've written, I agree!  ]

       

      Object:  find all paras with a "word spacing more than 100% desired" and apply them "a word spacing 95% desired"!

       

      var myParas = app.activeDocument.stories.everyItem().paragraphs.everyItem().getElements();  
      var mydesiredWordSpacing_0 = 100;  
      var mydesiredWordSpacing_1 = 95;  
      for (p = 0; p < myParas.length; p++)  
          {  
              var mydesiredWordSpacing = myParas[p].desiredWordSpacing;  
              if (mydesiredWordSpacing > mydesiredWordSpacing_0) {  
                  mydesiredWordSpacing = mydesiredWordSpacing_1;  
                  myParas[p].desiredWordSpacing = mydesiredWordSpacing;  
              }  
          }
      
      

       

      (^/)