• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

[Win Ill 10] How to Call Javscript using Plugin code?

New Here ,
Jun 11, 2008 Jun 11, 2008

Copy link to clipboard

Copied

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
TOPICS
SDK

Views

699

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Guide ,
Jun 16, 2008 Jun 16, 2008

Copy link to clipboard

Copied

Where did you get ASScripting.h? I can't find it in the SDK!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 16, 2008 Jun 16, 2008

Copy link to clipboard

Copied

Its there in the following path

\\Adobe Illustrator 10 SDK\IllustratorAPI\General\ASScripting.h

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jun 17, 2008 Jun 17, 2008

Copy link to clipboard

Copied

LATEST
Ah, Illustrator 10? I'm afraid I can't help you then, there isn't an ASScripting.h header anymore, at least not in the CS3 SDK (nor in the CS2 SDK I believe).

If you're trying to use it in AI10 or CS it should still work I think. Beyond that, I have no idea. I'm not sure what the replacement is supposed to be.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines