Error on .run() in bridge script
Hello,
Can someone please help me on why the script is crashing on the createThumbnails().run(); line because i am pretty new to this.
Thanks!
#target bridge
function createThumbnails()
{
try
{
this.requiredContext = "\tExecute against Bridge main engine.\nBridge must be running.";
$.level = 1; // Debugging level
this.panelRef = null;
//alert(arguments[0]);
Folder("c:\\temp\\centraliser").create();
var loc = new Thumbnail(Folder("/C"));
loc.open();
this.t = new Thumbnail(File("/c/temp/aaa/BIB2.ai"));
app.document.select(this.t);
}
catch(e) {
alert( e + ":" + e.line );
}
}
createThumbnails.prototype.run = function()
{
if(!this.canRun())
{
return false;
}
var bmd = new BitmapData(this.t.spec);
if(bmd instanceof BitmapData)
{
var expPath = "C:\\temp\\centraliser\\" + this.t.name + ".jpg";
bmd.exportTo(new File(expPath));
return true;
}
$.writeln("ERROR:: Cannot render thumb");
return false;
}
createThumbnails.prototype.canRun = function()
{
if(BridgeTalk.appName == "bridge") { return true; }
$.writeln("ERROR:: Cannot render thumb");
$.writeln(this.requiredContext);
return false;
}
if(typeof(createThumbnails_unitTest) == "undefined") {
createThumbnails().run();
}
