1

My company sends PDF reports to clients from data we export from another program. I made a very simple batch export process in Adobe Illustrator by simply assigning variables to our PDF, exporting those variables to an XML file, and then using a python script to rewrite and copy the XML structure/variables from the CSV export data.

On loading the variables from an XML, this loads just fine. The problem comes when switching data sets, which we must do hundreds of times, even when macro/action batching "save a copy."

This message displays on each switch: "The current values have not been captured, and will be discarded upon switching data sets. Proceed?" Pressing "Yes" (or spacebar) "works" just fine; the data set doesn't just magically disappear like it seems to imply. However, when switching to check data accuracy visually, or just batching actions, it becomes very tedious.

I can't seem to find an option or preference to suppress these kinds of messages, which would be my first guess for a solution. Is there maybe an option or flag or parameter somewhere in the XML structure to tell it I don't care? Is there a workaround like a batch action or a "capture all"? Or any other possibility?

1 Answer 1

2

Are you using visibility or graph variables? How about different whitespace symbols or unusual glyph fonts? There are some "issues" which occur during the population of data into the placeholders, and fortunately the fix is available by using this function on your Illustrator document.

function cycleUpdateAllDatasets(doc){
  for(var i = 0; i < doc.dataSets.length; i++){
    var d = doc.dataSets[i];
    d.display();
    d.update();
  };
};

The method is to display and update each dataset to make it 'ok' in the eyes of Illustrator. Whatever invisible changes Illustrator makes, the dataSet.update() command will rectify and hopefully send you on your way. You can play this .jsx script in bulk before you get on with your processing, but also you can play it during your processing on the active dataset right after it's populated (the insert menu command to insert a File > Scripts script into your action).

4
  • I'm not much for Javascript - how would I adapt this as a standalone script to run as part of the "save a copy" batch action? When I tried simply inserting and calling the function, I get error 21 undefined is not an object. I assume it's because I'm not defining "doc," but like I said, I don't know javascript.
    – Xodarap777
    Dec 1, 2016 at 4:38
  • Nevermind;I just added var doc = app.activeDocument;- Easy enough to just use the script once. Still curious how I would adapt it for batch use, though, if you have the time.
    – Xodarap777
    Dec 1, 2016 at 4:42
  • 1
    Glad it worked. Well, for batch-processing there's a way, but it's got own pesky issues. First, you would create a "single-dataset" snippet which would be as simple as: app.activeDocument.activeDataSet.update() Then you'd save this as a .jsx file in your Illustrator's application folder. Windows path is: C:\Program Files\Adobe\Adobe Illustrator CC 2017\Presets\en_US\Scripts Restart your AI, and this will appear in your File > Scripts menu. Then, in your Actions you use the flyout menu of the panel to do an "Insert Menu Item" command and insert this new script of yours.
    – Silly-V
    Dec 1, 2016 at 15:23
  • 1
    After that, you can play this action which will play this script on your batch of documents! Problem is that these action-script menu item references don't stick after Illustrator restarts, so you can check this out for an ameliorating solution.
    – Silly-V
    Dec 1, 2016 at 15:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.