Skip to main content
Known Participant
January 7, 2016
Answered

Create an artboard from a rectangle

  • January 7, 2016
  • 2 replies
  • 1895 views

This is probably a simple question and I've searched, but haven't found a specific answer to this question.

I created a rectangle and would like to then convert that to an artboard.  Is there an easy way to take my rectangle and just run a function to convert it to an artboard?

Thanks!

This topic has been closed for replies.
Correct answer CarlosCanto

or

app.activeDocument.artboards.add(selection[0].geometricBounds);

selection[0].remove();

2 replies

joro126Author
Known Participant
January 7, 2016

Thanks to you both. I ended up using CarlosCanto's answer since it just worked with my existing code.  I'm still getting my head wrapped around scripting in illustrator and this community has been very helpful.  Thanks again!

Silly-V
Legend
January 7, 2016

If you simply need to do this and not do it necessarily from a scripting environment, you can simply assign a keyboard shortcut to the Object > Artboards > Convert to Artboard menu item which does exactly what you want: turn a rectangle into an artboard.

joro126Author
Known Participant
January 7, 2016

That's exactly the behavior I want, but within a scripting environment.

Ten A
Community Expert
Community Expert
January 7, 2016

Try this:

app.executeMenuCommand("setCropMarks")