Copy link to clipboard
Copied
need object aligin to artboard, by java script in illustrator
Copy link to clipboard
Copied
// select an object
var doc = app.activeDocument;
var ABR = doc.artboards[doc.artboards.getActiveArtboardIndex()].artboardRect;
doc.selection[0].position = [
(ABR[0] + ((ABR[2] - ABR[0]) / 2)) - (doc.selection[0].width / 2),
(ABR[1] + ((ABR[3] - ABR[1]) / 2)) + (doc.selection[0].height / 2)
];
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Hello,
I decided to write some code for aligning objects a few years ago, after some try and tesing, I encountered a problem with "Nested Objets" and "clip masked" objects that was a trouble.
finally I decided to use Action and Scripts in combination! and result was acceptable.
with a panel and some conrol buttons I manipulate the proper actions.
this is my "Easy Align" panel for Adobe Illustrator: