Question
How to access script from within Bridge
I have considerable experience scripting InDesign, but this is my first
Bridge script...
The following script does what I want from within the ESTK, but I have
no idea what to do to make it runnable from within Bridge... :(
Any pointers?
var brSel = app.document.selections[0].spec.toString();
var bt = new BridgeTalk();
//brSel = brSel.toSource();
bt.target = "indesign";
theScript = "var IDsel = app.selection[0]; \n";
theScript += "if (IDsel instanceof Graphic){ \n";
theScript += "var theGraphic = IDsel;\n";
theScript += "}else{\n";
theScript += "var theGraphic = IDsel.graphics[0];\n";
theScript += "}\n";
theScript += "var theFile = File(\""+brSel+"\");\n";
theScript += "theGraphic.itemLink.relink(theFile);\n";
theScript += "theGraphic.itemLink.update();\n";
bt.body=theScript;
bt.send()
Thanks,
Harbs
Bridge script...
The following script does what I want from within the ESTK, but I have
no idea what to do to make it runnable from within Bridge... :(
Any pointers?
var brSel = app.document.selections[0].spec.toString();
var bt = new BridgeTalk();
//brSel = brSel.toSource();
bt.target = "indesign";
theScript = "var IDsel = app.selection[0]; \n";
theScript += "if (IDsel instanceof Graphic){ \n";
theScript += "var theGraphic = IDsel;\n";
theScript += "}else{\n";
theScript += "var theGraphic = IDsel.graphics[0];\n";
theScript += "}\n";
theScript += "var theFile = File(\""+brSel+"\");\n";
theScript += "theGraphic.itemLink.relink(theFile);\n";
theScript += "theGraphic.itemLink.update();\n";
bt.body=theScript;
bt.send()
Thanks,
Harbs
