Copy link to clipboard
Copied
Hey everyone,
Does anyone know of a script that will create artboards for each separate layer?
Thanks in advance,
Andy
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
Copy link to clipboard
Copied
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;
};
};
Copy link to clipboard
Copied
Thanks for making this!
Copy link to clipboard
Copied
Sorry to be a newb but can you tell me how I can run or execute this script on a file?
Copy link to clipboard
Copied
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.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now