0 Replies Latest reply on May 7, 2014 5:17 AM by Trojanonator

    While changing text item contents, text item size automatically change.

    Trojanonator

      For example : I have text with size 53,14 pt, script change content, and text size is 30 pt. Does anyone have any idea why is this happening ? Even when I try alert(layer.size); it will show 30pt.

       

      //function generated from action

      cTID = function(s) { return app.charIDToTypeID(s); };

      sTID = function(s) { return app.stringIDToTypeID(s); };

       

       

      selectLayer("odbor");

      var odborLayer = doc.activeLayer.textItem;

      odborLayer.contents = odbor;

       

       

      function selectLayer(name) {

        // Select

        function step1(enabled, withDialog) {

          if (enabled != undefined && !enabled)

            return;

          var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);

          var desc1 = new ActionDescriptor();

          var ref1 = new ActionReference();

          ref1.putName(cTID('Lyr '), name);

          desc1.putReference(cTID('null'), ref1);

          desc1.putBoolean(cTID('MkVs'), false);

          executeAction(cTID('slct'), desc1, dialogMode);

        };

        step1();      // Select

      };