Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Create an artboard from a rectangle

Community Beginner ,
Jan 06, 2016 Jan 06, 2016

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!

TOPICS
Scripting
1.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jan 06, 2016 Jan 06, 2016

or

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

selection[0].remove();

Translate
Adobe
Valorous Hero ,
Jan 06, 2016 Jan 06, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 06, 2016 Jan 06, 2016

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 06, 2016 Jan 06, 2016

Try this:

app.executeMenuCommand("setCropMarks")

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 06, 2016 Jan 06, 2016

or

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

selection[0].remove();

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 07, 2016 Jan 07, 2016
LATEST

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!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines