Hi, not got access to attach files so below is what I was talking about.
#target indesign
function main() {
if (app.documents.length == 0) {
alert("Please have an 'Indesign' document before running this script.");
return;
}
var docRef = app.documents[0];
$.sleep( 3000 ); // Just my novice delay method
updateGraph();
$.sleep( 3000 ); // Ditto here
//updateGraph();// done this twice because there seems to be a bug where the dataset is not getting updated first time around
$.sleep( 3000 );
//} //end for
updateLinks(docRef);
};
// Reverse loop to do this
function updateLinks(docRef) {
for (var i = docRef.links.length-1; i >= 0; i--) {
//if (docRef.links.status == LinkStatus.linkOutOfDate) {
docRef.links.update();
// } if clause end
}// for
}
// A basic Bridge Talk example
function updateGraph() {
if ( BridgeTalk.isRunning( "bridge" ) ) {
var bt = new BridgeTalk();
bt.target = "illustrator";
bt.body = "#target illustrator" + "\r"
+ "var DBHelper = {" + "\r"
+ "mainFs: null," + "\r"
+ "loadFile: function(fileOrFilename, isAI) {" + "\r"
+ "var _fl = (fileOrFilename instanceof 'File') ? fileOrFilename : new File(fileOrFilename);" + "\r"
+ " if(isAI) { myDoc = app.open(_fl);}" + "\r"
+ "else {" + "\r"
+ "myDoc.importVariables(_fl);" + "\r"
+ "this.mainFs = app.activeDocument.path.fullName + '/' + app.activeDocument.name;" + "\r"
+ " myDoc.save();" + "\r"
+ "myDoc.close(SaveOptions.SAVECHANGES);" + "\r"
+ "$.sleep( 3000 );" + "\r"
+ "this.loadFile(this.mainFs,true);" + "\r"
+ "}" + "\r"
+ "}," + "\r"
+ "displaySet: function(setName) {" + "\r"
+ "app.activeDocument.activeDataset = myDoc.dataSets.getByName(setName);" + "\r"
+ "app.activeDocument.activeDataset.display();" + "\r"
+ "app.activeDocument.close(SaveOptions.SAVECHANGES);" + "\r"
+ "$.sleep( 3000 );" + "\r"
+ "}" + "\r"
+ "}" + "\r"
+ "DBHelper.loadFile('/u/adobe indesign/Capella Gross Sector Exposure.ai', true);" + "\r"
+ "DBHelper.loadFile('/u/adobe indesign/Capella Gross Sector Exposure2.xml',false);" + "\r"
+ "DBHelper.displaySet('Capella');" + "\r"
// Save to modify the link status
//+ "myDoc.close(SaveOptions.SAVECHANGES);";
bt.send();
}
else
{
alert ("Please start Adobe Bridge");
}
}
main();
This should be it ... my original code was a lil bit messy cause was written in a hurry 
#target indesign
function main() {
if (app.documents.length == 0) {
alert("Please have an 'Indesign' document before running this script.");
return;
}
var docRef = app.documents[0];
$.sleep( 3000 ); // Just my novice delay method
updateGraph();
$.sleep( 3000 ); // Ditto here
//updateGraph();// done this twice because there seems to be a bug where the dataset is not getting updated first time around
$.sleep( 3000 );
//} //end for
updateLinks(docRef);
};
// Reverse loop to do this
function updateLinks(docRef) {
for (var i = docRef.links.length-1; i >= 0; i--) {
//if (docRef.links.status == LinkStatus.linkOutOfDate) {
docRef.links.update();
// } if clause end
}// for
}
// A basic Bridge Talk example
function updateGraph() {
if ( BridgeTalk.isRunning( "bridge" ) ) {
var bt = new BridgeTalk();
bt.target = "illustrator";
bt.body = "#target illustrator" + "\r"
+ "var DBHelper = {" + "\r"
+ "mainFs: null," + "\r"
+ "myDoc: null," + "\r"
+ "loadFile: function(fileOrFilename, isAI) {" + "\r"
+ "var _fl = (fileOrFilename instanceof 'File') ? fileOrFilename : new File(fileOrFilename);" + "\r"
+ " if(isAI) { this.myDoc = app.open(_fl);}" + "\r"
+ "else {" + "\r"
+ "this.myDoc.importVariables(_fl);" + "\r"
+ "this.mainFs = app.activeDocument.path.fullName + '/' + app.activeDocument.name;" + "\r"
+ "this.myDoc.save();" + "\r"
+ "this.myDoc.close(SaveOptions.SAVECHANGES);" + "\r"
+ "$.sleep( 3000 );" + "\r"
+ "this.loadFile(this.mainFs,true);" + "\r"
+ "}" + "\r"
+ "}," + "\r"
+ "displaySet: function(setName) {" + "\r"
+ "this.myDoc.activeDataset = this.myDoc.dataSets.getByName(setName);" + "\r"
+ "this.myDoc.activeDataset.display();" + "\r"
+ "this.myDoc.close(SaveOptions.SAVECHANGES);" + "\r"
+ "$.sleep( 3000 );" + "\r"
+ "}" + "\r"
+ "}" + "\r"
+ "DBHelper.loadFile('/u/adobe indesign/Capella Gross Sector Exposure.ai', true);" + "\r"
+ "DBHelper.loadFile('/u/adobe indesign/Capella Gross Sector Exposure2.xml',false);" + "\r"
+ "DBHelper.displaySet('Capella');" + "\r"
// Save to modify the link status
//+ "DBHelper.myDoc.close(SaveOptions.SAVECHANGES);";
bt.send();
}
else
{
alert ("Please start Adobe Bridge");
}
}
main();
cheers;