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

Create Fitted Artboards from layers?

Explorer ,
Oct 08, 2012 Oct 08, 2012

Hey everyone,

Does anyone know of a script that will create artboards for each separate layer?

Thanks in advance,

Andy

TOPICS
Scripting
6.7K
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

Guru , Oct 09, 2012 Oct 09, 2012

While I think this is possible ( not actually tried this out ) it would only make sence to do… if each layer's art does not over lap in any way?

#target illustrator

main();

function main() {

 

          if ( app.documents.length == 0 ) { return; }

          var doc = app.activeDocument;

 

          doc.layers[0].hasSelectedArtwork = true;

 

          doc.fitArtboardToSelectedArt( 0 );

 

          doc.selection = null;

          for ( var  i = 1; i < doc.layers.length; i++ ) {

 

                    doc.art

...
Translate
Adobe
Guru ,
Oct 09, 2012 Oct 09, 2012

While I think this is possible ( not actually tried this out ) it would only make sence to do… if each layer's art does not over lap in any way?

#target illustrator

main();

function main() {

 

          if ( app.documents.length == 0 ) { return; }

          var doc = app.activeDocument;

 

          doc.layers[0].hasSelectedArtwork = true;

 

          doc.fitArtboardToSelectedArt( 0 );

 

          doc.selection = null;

          for ( var  i = 1; i < doc.layers.length; i++ ) {

 

                    doc.artboards.add( [0,0,72,-72] );

 

                    doc.layers.hasSelectedArtwork = true;

 

                    doc.fitArtboardToSelectedArt( i );

 

                    doc.selection = null;

          };

};

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
New Here ,
Mar 20, 2017 Mar 20, 2017

Thanks for making this!

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 ,
Feb 01, 2018 Feb 01, 2018

Sorry to be a newb but can you tell me how I can run or execute this script on a file?

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 ,
Feb 02, 2018 Feb 02, 2018
LATEST

Hi HH,

Installing scripts in the Scripts menu

To include a script in the Scripts menu (File > Scripts), save the script in the Scripts folder, located in the

/lllustrator CC/Presets folder in your lllustrator CC installation directory, for example C:\Program Files\Adobe\Adobe Illustrator CC 2018\Presets\en_US\Scripts

.

The script’s filename, minus

the file extension, appears in the Scripts menu.

Scripts that you add to the Scripts folder while Illustrator is running do not appear in the Scripts menu until

the next time you launch Illustrator.

Any number of scripts can be installed in the Scripts menu. If you have many scripts, use subfolders in the

Scripts folder to help organize the scripts in the Scripts menu. Each subfolder is displayed as a separate

submenu containing the scripts in that subfolder.

Executing scripts from the Other Scripts menu item

The Other Scripts item at the end of the Scripts menu (File > Scripts > Other Scripts) allows you to execute

scripts that are not installed in the Scripts folder.

Selecting Other Scripts displays a Browse dialog, which you use to navigate to a script file. When you select

the file, the script is executed.

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