Help: open multiple AI files produced error in the Palette. (Error: 8702, there is no document.)

I try to open the files have mulitple via the palette dialog box but it fails on the error: 8702, there is no document. But if I change to win var = new window ('dialogue', 'Batch'); Open the file works well. Did someone help out me?

var txtSourceFolder = win.add ("edittext", undefined);

btnOk var = win.add ("button", undefined, "Run");

{btnOk.onClick = function ()}

Try

{

var sourceFolder = new Folder (txtSourceFolder.text);

var srFileType = "*.ai.

var files = sourceFolder.getFiles (srFileType);

If (sourceFolder! = null)

{

If (files.length > 0)

{

for (i = 0; i < files.length; i ++)

{

var optRef = new OpenOptions();

optRef.updateLegacyText = true;

sourceDoc = app.open (files [i], DocumentColorSpace.CMYK, optRef); Returns the document object

}

Alert ("the files are saved as HAVE in" + destFolder);

}

on the other

{

Alert ("no file found");

}

}

}

catch (Err)

{

If (err.substring)

{

Alert ("Error:" + err);

}

on the other

{

Alert ("Error:" + (err.number & 0xFFFF) + ', ' + err.description);

}

}

}

Win.Center ();

Win.Show ();

You must use BridgeTalk to have your talking Palette in Illustrator, search the forums, we have published several scripts that show how.

Tags: Illustrator

Similar Questions

Maybe you are looking for

  • Overview of slow disk file external nas

    I've just converted our office of a XP OS to Apple running El Cap and have installed a new drive NAS netgear ethernet network. We currently live preview of file very slow speeds. Some large directories sit at 15 seconds to display the files. I chose

  • Qosmio G30-126 - how to access the bios!

    I have a laptop Qosmio G30-126 and I don't know the key to enter the bios to change real estate for the HARD drive or something... then how to access the bios? What is the key for the bios?

  • where the library icloud for ipod shuffle?

    I am trying to load music from my computer Apple and get this message turn on icloud library - where is it?

  • Satellite A300/Y01 - Question on the remote control

    There is a remote that comes with the A300/Y01 (http://asia.cnet.com/cnet/i/r/2008/nb/43187224/sc004.jpg).I want to know if I have a USB infrared for my A300/U01 Sat. And buy a Toshiba remote that's going to work? And where can I buy this remote cont

  • Two monitors Windows 7

    I have Windows 7 and recently got a second monitor.  I plugged both monitors and they reflect each other.  All online says at pass the new display detected to put in place the second monitor, but the NEW DISPLAY DETECTED option does not appear in my