Skip to main content
Inspiring
June 14, 2013
Question

How to enable scale styles

  • June 14, 2013
  • 1 reply
  • 1079 views

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

This topic has been closed for replies.

1 reply

Paul Riggott
Inspiring
June 14, 2013

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 );

};

Sudha_KAuthor
Inspiring
June 17, 2013

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