scripting via estk
Hello,
What i am trying to do is generate a jpg image from an ai file(not a drawing, but a library = not possible to open in pdf) shown in bridge.
I have my script, it is working correct when executing this in estk.
And if i understand correct, i need to create an object of illustrator in order to execute the script in my vb.net program. But, because this script has nothing to do with illustrator in general i was wondering if it is also posible to create an object of the estk program and execute the script in the background with this object instead of illustrator?
Thanks
Also another question:
When ran from vb.net, it goes in debug.
#target bridge
#targetengine "MainEngine"
function SnpCreateThumbInspectorPanel()
{
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\\illustratorcentraliser").create();
//LINE 17 HERE
var loc = new Thumbnail(Folder("/C"));
loc.open();
this.t = new Thumbnail(File("/c/00_sym.ai"));
app.document.select(this.t);
}
catch(e) {
alert( e + ":" + e.line );
}
}
SnpCreateThumbInspectorPanel.prototype.run = function()
{
if(!this.canRun())
{
return false;
}
var bmd = new BitmapData(this.t.spec);
if(bmd instanceof BitmapData)
{
var expPath = "C:\\temp\\illustratorcentraliser\\" + this.t.name + ".jpg";
bmd.exportTo(new File(expPath));
return true;
}
$.writeln("ERROR:: Cannot render thumb");
return false;
}
SnpCreateThumbInspectorPanel.prototype.canRun = function()
{
if(BridgeTalk.appName == "bridge") { return true; }
$.writeln("ERROR:: Cannot render thumb");
$.writeln(this.requiredContext);
return false;
}
if(typeof(SnpCreateThumbInspectorPanel_unitTest) == "undefined") {
new SnpCreateThumbInspectorPanel().run();
}
it says
---------------------------
Script Alert
---------------------------
ReferenceError: Thumbnail does not have a constructor:17
---------------------------
OK
---------------------------
the code i am using in vb.net is
dim illy as illustrator.application = CreateObject("Illustrator.Application")
illy.DoJavaScriptFile("C:\previewSelectedLibrary.jsx")
Message was edited by: abjelly
