Hi All,
IDE:Microsoft VC++ 6.0
Illustrator :Version 10
I want to call a javascript from Vc++ code using SDK .I found a sample code to do this in "ASScripting.h" header.
Here is the code:
/***********************************************/
How to use the Scripting suite:
/*To execute a JavaScript script inside a host application, you must acquire
and use a JavaScript engine instance.
A typical use of the engine:*/
ASJavaScriptEngineRef jsEngineRef = NULL;
ASAPI err = kSpNoError;
err = sScriptingSuite->CreateJavaScriptEngine( &jsEngineRef );
if ( err == kSPNoError )
{
const char scriptText[] = "documents.add();" // Script to create a new document
const char * result = NULL;
err = sScriptingSuite->ExecuteJavaScript( jsEngineRef, scriptText, &result );
if ( err == kASScriptExecutionError )
{
// If error during execution, display a dialog containing returned error information string.
ErrorAlert( result );
}
}
...
err = sScriptingSuite->DeleteJavaScriptEngine( jsEngineRef );
jsEngineRef = NULL;
/***********************************************/
But this does not work!I think the "CreateJavascriptEngine" method fails to work.Pls advice on this.Any help is highly appreciated.
Regards
myRiaz