0 Replies Latest reply on Jul 7, 2014 7:40 AM by HarveyLiu

    Can you fix the script error?

    HarveyLiu Level 1

      I have got this script call “step backward“, it mean if run the script that can let the text step left of 8mm.

       

      var doc = app.properties.activeDocument,   
              myParas = doc && app.selection.length && app.selection[0].hasOwnProperty(‘paragraphs’) && app.selection[0].paragraphs.everyItem ().getElements ().slice(0),   
              l = myParas && myParas.length,   
              hvs = doc.viewPreferences.horizontalMeasurementUnits;   
      if (!l) exit();   
      doc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.MILLIMETERS;   
      while (l--) myParas[l].leftIndent -= 8;   
      doc.viewPreferences.horizontalMeasurementUnits = hvs;

       

      but if a empty return came to before of the text I will get this error, can some one help me to fix this problem?


      stepbackward�鞎�.jpg

       


      I expect:

      if that has an empty return came to before of the this, the script can move a step to right of empty return first and then move all the selection a step to left