Script problem with path (CS3 JS)
Hi -- I have written a script that launches from InDesign then goes to Bridge. A boiled down version is below. What I am finding is this script works perfectly as long as the folder I am referring to is the last one accessed by Bridge. If it was a different folder, bridge stills fires up and selects the desired thumbnail but then stops. The next time I run it, it works fine as long as I am accessing that same folder (the one that failed the first time). Any ideas would be greatly appreciated.
var myPath = "C:\\myfolder\\mypic.jpg";
var bt = new BridgeTalk;
bt.target = "bridge";
var myScript = 'app.document.thumbnail = new Thumbnail(File("' + myPath + '"));\n';
myScript += 'var sels = app.document.selections;\n';
myScript += 'for( var i = 0; i < sels.length; ++i ) {\n';
myScript += 'var md = sels.synchronousMetadata;\n';
myScript += 'app.synchronousMode = true;\n';
myScript += 'md.namespace = "http://ns.adobe.com/photoshop/1.0/";\n'
myScript += 'md.Caption = "This is my caption text test";\n';
myScript += '};\n';
bt.body = myScript;
bt.send();
