Skip to main content
Participant
May 23, 2022
Question

Artboard Alignment

  • May 23, 2022
  • 2 replies
  • 1307 views

Hello! Please tell me, if I have 50 artboards and 50 pictures in the file, each of which needs to be aligned relative to its artboard.. Is it possible to simultaneously align 50 pictures on 50 artboards? If yes, how can this be done?

This topic has been closed for replies.

2 replies

Kurt Gold
Community Expert
Community Expert
July 11, 2022

Apparently, you've got one single group on each artboard. Based on that assumption, you may do it in a couple of steps.

 

  1. Delete all artboards but one.
  2. Select all groups and run this excellent script, provided by Alexander Ladygin.
  3. Execute the "Rearrange Artboards" command that is located in the menu of the Artboards palette.
  4. Choose the Artboard tool, select all artboards and set their size to the desired (uniform) dimensions in the Control palette (or Properties palette). Reference point: centre.
  5. Rearrange the artboards again, if desired/required.
  6. Delete the remaining (empty) artboard.

 

It could also be done with an action (partially), but the scripting route is more straightforward in this case.

 

nutalinaAuthor
Participant
July 11, 2022

Thank you!
I will try)

femkeblanco
Legend
July 11, 2022

As @Kurt Gold said, you appear to have one item (a group) per artboard.   This simple script should centre these items.  It will ignore artboards with >1 item though. 

var doc = app.activeDocument;
var ABs = doc.artboards;
var output = "";
for (var i = 0; i < ABs.length; i++) {
    ABs.setActiveArtboardIndex(i);
    doc.selectObjectsOnActiveArtboard();
    var d = doc.artboards[i].artboardRect;
    if (doc.selection.length == 1) {
        var w = doc.selection[0].width;
        var h = doc.selection[0].height;
        doc.selection[0].position = [
            (d[0] + ((d[2] - d[0]) / 2)) - w / 2,
            (d[1] + ((d[3] - d[1]) / 2)) + h / 2
        ];
    }
}

 

Anubhav M
Community Manager
Community Manager
July 7, 2022

Hello @nutalina,

 

Thanks for reaching out, and sorry for the late response. I would request you try the steps shared in this tutorial (https://www.youtube.com/watch?v=nk07Tlf8Qw0) and check if it helps.

 

Looking forward to your response.

 

Thanks,

Anubhav

nutalinaAuthor
Participant
July 8, 2022

Thanks) But in tutorial they duplicate the same element on several artboards. And I have a lot of different items, so this option will not work( For now I center them manually, but when there are about 100 items, it takes a lot of time.

nutalinaAuthor
Participant
July 11, 2022

Aligned how?  Are these placed items?  Can you provide further information with screenshots? 


Here is a collection of illustrations, each of these objects I placed in the center of the corresponding artboard..