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

Create an artboard from a rectangle

Community Beginner ,
Jan 06, 2016 Jan 06, 2016

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!

TOPICS
Scripting

Views

1.4K

Translate

Translate

Report

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();

Votes

Translate

Translate
Adobe
Valorous Hero ,
Jan 06, 2016 Jan 06, 2016

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Try this:

app.executeMenuCommand("setCropMarks")

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

or

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

selection[0].remove();

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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!

Votes

Translate

Translate

Report

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