Created
January 9, 2013 09:53
-
-
Save tehmou/4492002 to your computer and use it in GitHub Desktop.
Script for Adobe Illustrator that rasterizes all layers and groups the name of which starts with "rasterize". To run save as .jsx and open from File/Scripts/Other Script... or run with ExtendScript Toolkit.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var rasterizeOptions = new RasterizeOptions(); | |
rasterizeOptions.transparency = true; | |
function process (item) { | |
$.writeln(item.name); | |
if (/^rasterize/.exec(item.name)) { | |
app.activeDocument.rasterize(item, null, rasterizeOptions); | |
} else { | |
if (item.layers) { | |
for (var i = 0; i < item.layers.length; i++) { | |
process(item.layers[i]); | |
} | |
} | |
if (item.groupItems) { | |
for (var i = 0; i < item.groupItems.length; i++) { | |
process(item.groupItems[i]); | |
} | |
} | |
} | |
} | |
process(app.activeDocument); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thank you