1 Reply Latest reply on Mar 31, 2014 11:56 PM by Trevorׅ

    Create a dropdown list to change the measurement units

    தமிழ் கிறுக்கன் Level 1

      Hi All,


      Please help on creating a dropdown list with a UI, where by selecting all measurement units to change the trim size. Or can I invoke it by just adding as list items and call them with event listeners?



      Thanks in advance



        • 1. Re: Create a dropdown list to change the measurement units
          Trevorׅ Adobe Community Professional

          Hi Tamil,


          I don't know what you mean by trim size but is this what you are looking for ?



          #targetengine Tamil
          var doc = app.properties.activeDocument && app.activeDocument,
                measurementUnitsEnums = [MeasurementUnits.POINTS, MeasurementUnits.PICAS, MeasurementUnits.INCHES, MeasurementUnits.INCHES_DECIMAL, MeasurementUnits.MILLIMETERS, MeasurementUnits.CENTIMETERS, MeasurementUnits.CICEROS, MeasurementUnits.CUSTOM, MeasurementUnits.AGATES, MeasurementUnits.U, MeasurementUnits.BAI, MeasurementUnits.MILS, MeasurementUnits.PIXELS, MeasurementUnits.Q, MeasurementUnits.HA, MeasurementUnits.AMERICAN_POINTS];
          if (!doc) exit ();
          var   w = new Window('palette'),
                  dmu = w.add('dropdownlist', undefined, measurementUnitsEnums);
                  dmu.selection = doc.viewPreferences.horizontalMeasurementUnits.toString();
          dmu.onChange = function () {
              doc.viewPreferences.horizontalMeasurementUnits = 
              doc.viewPreferences.verticalMeasurementUnits = measurementUnitsEnums[dmu.selection.index];