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

object aligin to artboard, by java script in illustrator

Community Beginner ,
May 04, 2024 May 04, 2024

Copy link to clipboard

Copied

need object aligin to artboard, by java script in illustrator

TOPICS
Scripting

Views

232
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
Adobe
Guide ,
May 04, 2024 May 04, 2024

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

Votes

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 ,
May 04, 2024 May 04, 2024

Copy link to clipboard

Copied

Votes

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
Explorer ,
May 05, 2024 May 05, 2024

Copy link to clipboard

Copied

LATEST

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:

Votes

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