2 Replies Latest reply on Jun 17, 2013 2:35 AM by Sudha K

    How to enable scale styles

    Sudha K Level 1

      Hi,

       

        Im new to photoshop scripting.  I need to enable scale styles checkbox when I resizing the image.  I don't know how to do in javascript.

       

      If anyone knows pls help me.

       

       

      Thanks in advance,

      Sudha K

        • 1. Re: How to enable scale styles
          Paul Riggott Level 6

          You would use the scriptlistener output to get the code, as an example...

           

           

          resizeDoc(1000);
          function resizeDoc(W) {
          var desc = new ActionDescriptor();
          desc.putUnitDouble( charIDToTypeID('Wdth'), charIDToTypeID('#Pxl'), W );
          desc.putBoolean( stringIDToTypeID('scaleStyles'), true );
          desc.putBoolean( charIDToTypeID('CnsP'), true );
          desc.putEnumerated( charIDToTypeID('Intr'), charIDToTypeID('Intp'), stringIDToTypeID('bicubic') );
          executeAction( charIDToTypeID('ImgS'), desc, DialogModes.NO );
          };
          
          • 2. Re: How to enable scale styles
            Sudha K Level 1

            Hi,

             

              Thanks for ur timely help.  

             

              When I use this code, document getting resized for specified width value(1000) but scalestyles check is not enabled in Image size pallete.   How can I check whether scalestyles checkbox is enabled or not??

             

             

            Below resize code is working for ebnabling resample Image and  constrain propotional except ScaleStyles check box.

             

            activeDocument.resizeImage(new UnitValue(Ht, 'pixels'),undefined,300,ResampleMethod.BICUBICSHARPER )

             

             

            Thanks in advance,

            Sudha K