Copy link to clipboard
Copied
Hi All
I have written a simple script to to trace a raster image using Illustrator.
The image can be traced using >Object > Image trace in Illustrator without any problems.
However, when I run my script I get the following error: Application error 12321(some long number) 'MARC'.
Does anyone have any advice on how I could solve this problem?
Thank you!
Also, my code is below.
var jpgFilePath = new File ("/Users/Ellipse8.jpg")
createRasterItem(jpgFilePath)
function createRasterItem(jpgFilePath) {
var rasterFile = File(jpgFilePath);
var myDoc = app.documents.add();
var myPlacedItem = myDoc.placedItems.add();
myPlacedItem.file = rasterFile;
myPlacedItem.position = Array( 0, myDoc.height );
myPlacedItem.embed();
var thisImage = myPlacedItem.trace();
thisImage.tracing.tracingOptions.ignoreWhite = true;
thisImage.tracing.expandTracing();
redraw();
}
Copy link to clipboard
Copied
you don't need to embed your image after you place it, remove or comment the line and it should work
//myPlacedItem.embed();
Copy link to clipboard
Copied
Hey Carlos thank you for your advice.
I tried removing the embed line, but now there is no image at all displayed.
Perhaps my source image was the problem, I will try with a different image and see if it helps.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now