Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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 );
};
Copy link to clipboard
Copied
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