Skip to main content
Participant
February 18, 2022
Question

Does anyone have a script to export multiple assets that remain the size of the artboard?

  • February 18, 2022
  • 3 replies
  • 750 views

I'm creating an NFT that needs to have hundreds of PNG's layered ontop of one another. Because of this I need all my assets to export as the size of the artboard, not just the bounding box of the asset. I created all of my assets in layers on one artboard. 

Does anyone have a script to create multiple artboards within one document so that I can export that way? or a script to export all of my assets the size of the artboard?

HELP IM HOPELESS. 

 

This topic has been closed for replies.

3 replies

renél80416020
Inspiring
February 19, 2022

Bonjour,

Avec calques supperposés, essayez ceci...

// JavaScript Document
if ( app.documents.length > 0 ) {
  var exportOptions = new ExportOptionsPNG24();
      exportOptions.antiAliasing = false;
      exportOptions.transparency = false;
      exportOptions.saveAsHTML = true;
      exportOptions.artBoardClipping = true;
  var type = ExportType.PNG24;
  var fileSpec = "~/sample";

      for(var h = 0; h < activeDocument.layers.length; h++) {
         app.activeDocument.layers[h].visible = false;
      }
      for(h = 0; h < activeDocument.layers.length; h++) {
          activeDocument.layers[h].visible = true;
         app.activeDocument.exportFile( new File(fileSpec+"_"+h+".png"), type, exportOptions );
          activeDocument.layers[h].visible = false;
      }
      for(h = 0; h < activeDocument.layers.length; h++) {
         app.activeDocument.layers[h].visible = true;
      }
}

 

Silly-V
Legend
February 19, 2022

Can you try to use the Save-for-Web legacy option, there's a checkbox to 'clip to artboard'. Use it with Ctrl+Shift+S, but it only is good for exporting images that have a screen resolution. Even if you do need a higher resolution, you could still export at a very large scale and still at the 72 resolution, then put it through some photoshop batch process to down-size the dimensions while up-sizing the resolution.

However it's probably likely that Save-for-Web resolution may be ever prefereable, so try giving it a go.

 

Ton Frederiks
Community Expert
Community Expert
February 18, 2022