• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Setting Scale Corners in a script

New Here ,
Feb 10, 2017 Feb 10, 2017

Copy link to clipboard

Copied

I'm writing a script to fit an object into a specific sized box. I'm using:

artwork[0].resize(scale, scale ,1,1,1,1,scale);

in order to change the size. Everything seems to be working fine except if I have the "Scale Corners" check box in the Transform palette turned off. Then, of course, it doesn't scale the corners!

I can't figure out of there is a way to either, override that in the script or change the setting and then change it back when its done.

I tried:

getBooleanPreference("Scale Corners");

to see if I could get to it that way, but it doesn't match up with what is shown as selected!

Any ideas?

TOPICS
Scripting

Views

943

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Feb 11, 2017 Feb 11, 2017

Sorry, I misunderstand you before. Well, seems like we have to call an action.

var actionStr =

['/version 3',

'/name [1 73]',

'/actionCount 1',

'/action-1 {',

'    /name [ 12 7363616c65436f726e657273]',

'    /eventCount 1',

'    /event-1 {',

'        /internalName (ai_liveshapes)',

'        /parameterCount 1',

'        /parameter-1 {',

'            /key 1933800046',

'            /type (boolean)',

'            /value 1',

'        }',

'    }',

'}'].join('');

createAction(actionStr, 's');

app.doScript('scaleCorners'

...

Votes

Translate

Translate
Adobe
Enthusiast ,
Feb 10, 2017 Feb 10, 2017

Copy link to clipboard

Copied

Hi, to turn on the check box in script:

app.preferences.setBooleanPreference('scaleLineWeight', 1);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 10, 2017 Feb 10, 2017

Copy link to clipboard

Copied

Thanks @moluapple but that's not quite what I'm after. It's scale corners that I'm looking for.

Here's a pic showing what's going on! When the center logo is resized, the top right logo is what happens. And the bottom right is what I want. The check box I want to switch is the one bottom left in the transform panel. (Scale Corners)

resize-problem.png

I've now had a quick try at "app.preferences.setBooleanPreference('scaleCorners', 1);" (thanks for the suggestion) but that still doesn't seem to do it!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Feb 11, 2017 Feb 11, 2017

Copy link to clipboard

Copied

Sorry, I misunderstand you before. Well, seems like we have to call an action.

var actionStr =

['/version 3',

'/name [1 73]',

'/actionCount 1',

'/action-1 {',

'    /name [ 12 7363616c65436f726e657273]',

'    /eventCount 1',

'    /event-1 {',

'        /internalName (ai_liveshapes)',

'        /parameterCount 1',

'        /parameter-1 {',

'            /key 1933800046',

'            /type (boolean)',

'            /value 1',

'        }',

'    }',

'}'].join('');

createAction(actionStr, 's');

app.doScript('scaleCorners', 's');

app.unloadAction('s','');

function createAction (str, set) {

    var f = File(set + '.aia');

    f.open('w');

    f.write(str);

    f.close();

    app.loadAction(f);

    f.remove();

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 11, 2017 Feb 11, 2017

Copy link to clipboard

Copied

Hi moluapple​,

only one note (or better addition):

line #14 in your Code is the important line.

     '               /value 1', // value 0 for uncheck the option Scale Corners

Have fun

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Feb 11, 2017 Feb 11, 2017

Copy link to clipboard

Copied

LATEST

Of cause you are right.

Also note I had deleted some parts, only left the core parts of the .aia file, so now is the structure(1st line + 3 + 3 + 3 + 3 + end lines):

  • name
  • count
  • action/event/parameter details

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines