Skip to main content
StrongBeaver
Legend
May 7, 2016
Answered

Selections to Artboards ?

  • May 7, 2016
  • 3 replies
  • 3573 views

Is there any script that can take a selection or multiple selections and make artboards from those selections and so the artboards fit perfectly to the selection ?

This topic has been closed for replies.
Correct answer CarlosCanto

try this

for (var a=0; a<selection.length; a++) app.activeDocument.artboards.add(selection.geometricBounds);

StrongBeaver
Legend
May 23, 2016

My Layers panel is as such;

Layer1

-> Group

--> Letter1

--> Letter2

--> Letter3

--> Letter4

--> etc

The code I used was posted by Carlos in post #2, could it be the code won't work because the individual expanded letters are in a group ?

I completely oversaw post #6 by Carlos That is the result I want.

pixxxelschubser
Community Expert
Community Expert
May 24, 2016

StrongBeaver schrieb:

My Layers panel is as such;

Layer1

-> Group

--> Letter1

--> Letter2

--> Letter3

--> Letter4

--> etc

The code I used was posted by Carlos in post #2, could it be the code won't work because the individual expanded letters are in a group ?

I completely oversaw post #6 by Carlos That is the result I want.

pixxxel schubser schrieb:

Furthermore:

alert (app.activeDocument.selection.length);

alert (app.activeDocument.selection[0].typename);

It seems you completely oversaw my posting too:

pixxxel schubser schrieb:

… Because of:

If the selection is a group (if the word wasn't ungrouped after outlining) only one artboard will be added (with the code of in his post #1)

Ungroup the group, select the letters and runs Carlos script again.

You will get:

  • the existing artboards remains
  • every part of selection.length will adds an new artboard (5 letters will adds 5 artboards, but a group with 5 letters will adds only one artboard !!! )
CarlosCanto
Community Expert
Community Expert
May 24, 2016

The point is, grouped or ungrouped, at least one artboard should be created, something should be happening

StrongBeaver
Legend
May 11, 2016

I selected my selection, executed the code; but my selection was no placed on it's own artboard along side the artboard for which I selected my selection ?

CarlosCanto
Community Expert
Community Expert
May 11, 2016

please show screenshots of the results you're getting and the results you need.

StrongBeaver
Legend
May 23, 2016

Sorry for the delay, I put a hold on this issue for a bit.

What I meant was, the word previous each letter is a selection, then each selection is placed in it's own artboard; with the artboard matching the selection.

CarlosCanto
Community Expert
CarlosCantoCommunity ExpertCorrect answer
Community Expert
May 9, 2016

try this

for (var a=0; a<selection.length; a++) app.activeDocument.artboards.add(selection.geometricBounds);

Disposition_Dev
Legend
May 10, 2016

This works great Carlos, as long as there are no clipping masks. Unfortunately, Illustrator treats the contents of the clipping mask as "visible" even though any artwork outside the clipping mask is not visible...

Hopefully you don't have clipping masks in your files, StrongBeaver​.. If so, let us know and we'll try and help you out with that contingency.