Scaling in Illustrator with AppleScript or other language

New Here ,
Apr 04, 2022 Apr 04, 2022

Copy link to clipboard

Copied

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.

TOPICS
Scripting

Views

68

Likes

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
Advocate ,
Apr 04, 2022 Apr 04, 2022

Copy link to clipboard

Copied

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

 

Likes

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 ,
Apr 05, 2022 Apr 05, 2022

Copy link to clipboard

Copied

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.

Likes

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
Contributor ,
Apr 05, 2022 Apr 05, 2022

Copy link to clipboard

Copied

LATEST

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

 

Likes

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