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

need object aligin to artboard, by java script in illustrator

TOPICS
Scripting
238
Translate
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
// 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)
];
Translate
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
Translate
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
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:

Translate
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