Skip to main content
Participant
April 4, 2022
Question

Scaling in Illustrator with AppleScript or other language

  • April 4, 2022
  • 1 reply
  • 620 views

I'm scaling a group up 200% with the standard AS approach, but sometimes rule thickness is not being scaled, or rules fail to meet up after scaling. Manually, I can resolved this by checking Scale Corners and Scale Strokes & Effects in the Scale dialog, or using the Expand menu item.

 

But I'm not seeing support for either approach via scripting. I've checked all the optional script parameters, most of which are set to true by default anyone. Example code:

scale selection horizontal scale scalePercentage vertical scale scalePercentage with transforming objects, transforming fill gradients, transforming fill patterns and transforming stroke patterns

TIA.

This topic has been closed for replies.

1 reply

femkeblanco
Legend
April 4, 2022

In JavaScript, changeLineWidths is the seventh parameter of resize() and is the same scale factor. 

 

// select item
var f = 200;  // scale factor
app.selection[0].resize(f, f, undefined, undefined, undefined, undefined, f);

 

Participant
April 5, 2022

Thank you. I will use JavaScript for this. There is no resize command in AppleScript, and the scale command does not have this parameter. Curious difference.

Inspiring
April 5, 2022

It’s the same command, named `scale` in AS and `resize` in JS. The parameter you want is `line scale`:

 

tell application "Adobe Illustrator"
	tell document 1
		scale path item 1 horizontal scale 200 vertical scale 200 line scale 200
	end tell
end tell