document.rasterize() crashing illustrator
Hello,
I've been trying to use a jsx script to rasterize a specific layer called Artwork. This is my script below. Everytime I try to trigger the script, it crashes Illustrator. I've narrowed it down to the last line of code that seems to be crashing it, but that is the only line of code I can see in the scripting doc that will do what I need it to.
I'm using Illustrator 2022 but I've also tried it on 2023 and that also doesn't work. I don't suppose this is a glitch is it or is my script wrong?
Thanks very much.
var doc = app.activeDocument;
var sourceArt = doc.layers.getByName("Artwork");
var clipBounds = undefined;
// Rasterization options
var options = new RasterizeOptions();
options.resolution = 300;
options.antiAliasingMethod.TYPEOPTIMIZED;
options.transparency = true;
options.convertSpotColors = false;
options.includeLayers = true;
// Rasterize layers with options
doc.rasterize(sourceArt, clipBounds, options);
