2 Replies Latest reply on Apr 4, 2016 11:24 AM by Prithivi_Prepress

    select a text frame with lable

    Prithivi_Prepress Level 1

      I am trying to catch a text frame from document page 2 with script label "main text" but below script is not working.

       

      app.activeDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;

      app.activeDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;

      app.activeDocument.viewPreferences.rulerOrigin = RulerOrigin.spreadOrigin;

       

       

      try

      {

      var jt=app.activeDocument.pages[2].textFrames;

      for (i=0;i<jt.length;i++)

      if (jt[i].label=="Main Text")

      jt[i].TextFramePreference.autoSizingType=AutoSizingTypeEnum.HEIGHT_ONLY;

      }

      catch(e){

          alert("nothing happened");

          }

       

       

      Can some one please help me what is the error here.