Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Why does my trace script give an application error?

New Here ,
Jul 24, 2013 Jul 24, 2013

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();

}

TOPICS
Scripting
592
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Jul 24, 2013 Jul 24, 2013

you don't need to embed your image after you place it, remove or comment the line and it should work

//myPlacedItem.embed();

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 29, 2013 Jul 29, 2013
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines