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

Met1
Legend
July 7, 2022

YouTube vid is about text, not pictures, so this won't work...

OP you'll need to script this, or create an action (although I'm not sure if an action can move from one page to another - Kurt?)... although if you've been waiting since May this is probably no longer an issue...

Kurt Gold
Community Expert
Community Expert
July 8, 2022

Well, Met, this is rather a task for a script. I can imagine that it might also be possible with an action, but it would be pretty convoluted.

 

One thing that is always a bit arcane is the term "picture". To me it normally means a raster image, but there are many users that use it in terms of any kind of illustrations that can be done in Illustrator. Therefore it's difficult to suggest something without first taking a look at a sample file.