Copy link to clipboard
Copied
Hi, I'm trying to create a script that will rasterize an object with certain resolution, but to no avail, what am I doing wrong, can anyone give me a hint?
#target illustrator
function rasterItem() {
var sourceDoc = app.activeDocument;
var currentItem = sourceDoc.pathItems[0]
var resolucao = rasterizeOptions.resolution = (resolution / 72) * 400;
currentItem.selected = true;
activeDocument.rasterize( currentItem, currentItem.visibleBounds, resolucao );
}
rasterItem();
function rasterItem() {
var sourceDoc = app.activeDocument;
var currentItem = sourceDoc.pathItems[0]
var rasterOpts = new RasterizeOptions;
rasterOpts.resolution = 96; //(resolution / 72) * 400;
currentItem.selected = true;
activeDocument.rasterize( currentItem, currentItem.visibleBounds, rasterOpts );
}
rasterItem();
Copy link to clipboard
Copied
function rasterItem() {
var sourceDoc = app.activeDocument;
var currentItem = sourceDoc.pathItems[0]
var rasterOpts = new RasterizeOptions;
rasterOpts.resolution = 96; //(resolution / 72) * 400;
currentItem.selected = true;
activeDocument.rasterize( currentItem, currentItem.visibleBounds, rasterOpts );
}
rasterItem();
Copy link to clipboard
Copied
It worked perfectly, I did not know how to set the resolution option
Very thanks!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now