2

I am trying to update all the Data Sets in my Illustrator document so that when I do a Batch Action Save I don't get the following error:

The current values have not been captured and will be discarded upon switching data sets. Proceed?

I found this StackExchange answer here, but this script is not working on my Illustrator when I execute it from the File > Script > Other Scripts menu.

Here is the code:

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

I am not very familiar with javasript so I am not sure why the script isn't working and was hoping someone could shed some light on this?

I am on the Adobe Illustrator CC

1 Answer 1

2

The complete code is:

#target illustrator
function test () {
  var doc = app.activeDocument;
  function cycleUpdateAllDatasets (doc) {
    for (var i = 0; i < doc.dataSets.length; i++) {
      var d = doc.dataSets[i];
      d.display();
      d.update();
    };
  };
  cycleUpdateAllDatasets(doc);
}
test();
2
  • This was it! I am glad I managed to get you! :) I couldn't respond to the original post so I had to make a new question which I know is frowned upon in this community. Thank you!! Commented Apr 5, 2019 at 14:18
  • This is a-ok with me. I'm interested in how you use the variable data, it's quite a fun thing..
    – Silly-V
    Commented Apr 5, 2019 at 16:02

Your Answer

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

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