Skip navigation
jameslloydnelson
Currently Being Moderated

Raster multiple layers in AI without flattening to 1 layer

Aug 8, 2012 12:40 PM

Tags: #script #raster #ai

I am trying to turn every layer in my .ai file to a raster image without flattening to one layer. Im assuming a script would be best for this.

 

-The big issue I am dealing with is the agency that just built a paralax site for us refuses to export to PSD. I have tried every possible way to do this but keep getting the file is to big message. To add to it they had it all on 1 layer. I was able to release to sequence, but now am trying to see if rasterizing the objects will help.

 

Thanks so so much in advance we are in crisis mode.

 
Replies
  • Currently Being Moderated
    Aug 8, 2012 1:41 PM   in reply to jameslloydnelson

    I have this in my collection of scripts which I modified to save .psd files

    #target illustrator
     
    /**
    * @author Niels Bosma (niels.bosma@motorola.com
    */
     
    var folder = Folder.selectDialog();
    var document = app.activeDocument;
    if(document && folder)
    {    
        var options = new ExportOptionsPhotoshop();
        options.antiAliasing = true;
        options.resolution = 300.0;
         options.warnings = false;
        
        var n = document.layers.length;
        for(var i=0; i<n; ++i)
        {
            hideAllLayers();
            var layer = document.layers[i];
            layer.visible = true;
        
            var file = new File(folder.fsName+"/"+layer.name+".png");
            document.exportFile(file,ExportType.PNG24,options);    
        }
        
        showAllLayers();
    }
     
    function hideAllLayers()
    {
        forEach(document.layers, function(layer) {
            layer.visible = false;
        });
    }
     
    function showAllLayers()
    {
        forEach(document.layers, function(layer) {
            layer.visible = true;
        });        
    }
     
    function forEach(collection, fn)
    {
        var n = collection.length;
        for(var i=0; i<n; ++i)
        {
            fn(collection[i]);
        }
    }
    
     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points