Changing anchor point for GroupItems insert

New Here ,
Nov 03, 2021 Nov 03, 2021

Copy link to clipboard

Copied

Hi all,

I'm quite new to ExtendScript. I'm trying to see if I can automate the placement of svg files into Illustrator from JavaScript

 

How do I change the anchor point of insertion of an svg file? Right now, the insertion is always w.r.t TOP LEFT as anchor, but I want to change it to CENTER. I'm trying to use the transform function but it's not working. Perhaps the syntax is wrong or I should be using another function?

var doc = app.activeDocument.layers["Icons"];
var svgFile = File('C:/Users/johns/Desktop/ArtPainting_f5c43e74-e16a-4bfc-af6a-145fbd21d5ea.svg' );
artboard=doc.groupItems.createFromFile(svgFile);
artboard.transform(false,false,false,false,undefined,Transformation.CENTER);
artboard.position=[58.98-15.4,-38.65];

 Appreciate the help.

 

Thanks!

TOPICS
Scripting

Views

32

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
no replies

Have something to add?

Join the conversation