Skip to main content
Known Participant
December 28, 2020
Answered

How to force "scale corners" when using .resize() ?

  • December 28, 2020
  • 1 reply
  • 942 views

I simply want to resize my objects but sometimes I accidentally leave the "scale corners" option unchecked therefore rounded corners don't scale proportionally along with the rest of the object. Is there a way to force the scaling of corners with .resize somehow or some other way?

 

I'm already using this but it ignores scaling corners if the user option is accidentally left disabled:

x.resize(scaleMult, scaleMult, true, true, true, true, scaleMult, undefined)

 

Expanding the objects won't work in this case as a workaround since my objects are simple squares and other path types.

Correct answer CarlosCanto
// get/set Scale Corners
// carlos canto - 12/28/2020
// https://community.adobe.com/t5/illustrator/how-to-force-quot-scale-corners-quot-when-using-resize/td-p/11710892?page=1

// save original state
var scaleCorners = app.preferences.getIntegerPreference ("policyForPreservingCorners");

// check Scale Corners
app.preferences.setIntegerPreference ("policyForPreservingCorners",1); // 1-checked, 2-unchecked

// DO YOUR THING

// Reset Original Scale Corners Settings
app.preferences.setIntegerPreference ("policyForPreservingCorners",scaleCorners);

1 reply

CarlosCanto
Community Expert
CarlosCantoCommunity ExpertCorrect answer
Community Expert
December 28, 2020
// get/set Scale Corners
// carlos canto - 12/28/2020
// https://community.adobe.com/t5/illustrator/how-to-force-quot-scale-corners-quot-when-using-resize/td-p/11710892?page=1

// save original state
var scaleCorners = app.preferences.getIntegerPreference ("policyForPreservingCorners");

// check Scale Corners
app.preferences.setIntegerPreference ("policyForPreservingCorners",1); // 1-checked, 2-unchecked

// DO YOUR THING

// Reset Original Scale Corners Settings
app.preferences.setIntegerPreference ("policyForPreservingCorners",scaleCorners);
jeefusAuthor
Known Participant
December 30, 2020

Thanks!

 

I found the "setIntegerPreference" method in the extendscript documentation but I was wondering where to find the information on the argument you provided for it. I can't find any list of information that contains the info like the "policyForPreservingCorners". How did you know that was the correct code?

CarlosCanto
Community Expert
Community Expert
December 30, 2020

All available settings are in the Settings folder, check these two files

Adobe Illustrator Prefs

Adobe Illustrator Cloud Prefs

 

some settings are easy to spot, some others have names that seem to have no relation to what you need. I do a lot of trial an error.