I have a .ai file with 3 datasets containing 2 variables each. I am new to adobe scripting and am trying to write a script that will loop through the 3 datasets, swap out the variables, and save as 3 different .pdf files. I can loop and export, but don't know how to access the variables.
Here is a snipped from what I have:
for (var i=0; i< docRef.dataSets.length; i++){
var ds1 = docRef.dataSets.getByName('ABC'); // ABC is a client name, but numeric index is required
//var ds1 = docRef.dataSets.index(1); // this doesn't seem to work, but i need it to
docRef.activeDataset = ds1;
// I need to access the dataset variables here, where ClientName is a variable name within the dataset
client_name = ?????;
ds1.display();
app.redraw();
// ----- save changes
filepath = '/Users/me/Documents/clients/'+client_name+'.pdf';
saveInFile = new File( filepath );
pdfSaveOpts = getPDFOptions( );
docRef.saveAs( saveInFile, pdfSaveOpts );
}
Thanks for any help
Here is a snipped from what I have:
for (var i=0; i< docRef.dataSets.length; i++){
var ds1 = docRef.dataSets.getByName('ABC'); // ABC is a client name, but numeric index is required
//var ds1 = docRef.dataSets.index(1); // this doesn't seem to work, but i need it to
docRef.activeDataset = ds1;
// I need to access the dataset variables here, where ClientName is a variable name within the dataset
client_name = ?????;
ds1.display();
app.redraw();
// ----- save changes
filepath = '/Users/me/Documents/clients/'+client_name+'.pdf';
saveInFile = new File( filepath );
pdfSaveOpts = getPDFOptions( );
docRef.saveAs( saveInFile, pdfSaveOpts );
}
Thanks for any help