Copy link to clipboard
Copied
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!
or
app.activeDocument.artboards.add(selection[0].geometricBounds);
selection[0].remove();
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
That's exactly the behavior I want, but within a scripting environment.
Copy link to clipboard
Copied
Try this:
app.executeMenuCommand("setCropMarks")
Copy link to clipboard
Copied
or
app.activeDocument.artboards.add(selection[0].geometricBounds);
selection[0].remove();
Copy link to clipboard
Copied
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!