4 Replies Latest reply on Mar 27, 2013 9:48 PM by BEGINNER_X

    Need selection textframe width

    BEGINNER_X Level 3

      Hi All,

       

      simple Request:

       

      If Selected textframe is "100mm" (alert pass)

       

      Otherwise selected textframe is !=100mm (alert fail)

       

       

      Code is below:

      app.activeDocument.viewPreferences.horizontalMeasurementUnits = app.activeDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.MILLIMETERS;

       

      if(app.selection[0].geometricBounds[3] - app.selection[0].geometricBounds[1] == "100mm")

      {

          alert("pass")

          }

      else

      {

          alert("fail")

          }

       

       

      I dont know where I did mistake.

       

      Could anyone give solution for my request.

       

      Thanks in advance

      Beginner_X