Distribute / align on edges of an artboard or a shape
A request to add two buttons to the "Align" options :
distributing shapes on an artboard in order to have equal spaces between those two shapes AND the edges of the artboard.
This could work with more than two shapes, and artboard could also be replaced by another shape (like a background color...).
This should be clearer with a picture...
-
Yes, sorry, UserVoice indeed forbids attaching files with JSX extension for security reasons.
The scripts work — thank you for sharing! — although I tried very simple case so far. Nothing like 'take the strokes into considerations' and 'move opacity masks' (scripts can’t do this, https://illustrator.uservoice.com/forums/908050/suggestions/46727548)... it seems to prefer the boundы of the clipped content instead of the clipping mask.
The 'within' one uses not the lastly selected object though, but the largest one. Alas, scripts can’t really do 'prefer the last selected' or 'use key object' (https://illustrator.uservoice.com/forums/908050/suggestions/32845666 — although clever hacks exist). -
Myron Tracy commented
Distribute Shapes Within
Again, open in notepad, save as .jsx
- select shapes to distribute, lastly select the rectangle/shape you wish to align within. -
Myron Tracy commented
Egor Chistyakov, can't attach jsx files. Here's a txt file, open in Notepad and save as .jsx
-
Myron Tracy commented
Let's try this again. May not be able to attach a jsx file.
-
Myron, would you share the script for others to use?
-
Myron Tracy commented
I have scripts for this.
-
Dina Dembicki
commented
I would use this feature, as I'm always setting up things this way. For now I just eyeball it and then group, then align the group to the center of the artboard. It's not important that the spaces between each item an the edge of the artboard are the same, IN MY WORKFLOW, but it would be a nice to have for sure.
-
A workaround I personally use when I need to distribute objects like this, is to draw two lines (vertical, in case I need to distribute horizontally, and vice versa), align each one to the opposite edges of an artboard, and then to distribute the whole selection as usual. This is no exactly fast, but doable. See the attached GIF for clarification.