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

I want to communication with c++ sdk plug-ins by javaScript

Explorer ,
Oct 20, 2008 Oct 20, 2008

Copy link to clipboard

Copied

When I created c++ indesign plug-ins, I used dollyx.

so, I create indesign server c++ sdk plus-ins by dollyx.

of couse, I choice InDesignServer.

and default sayHello() created successfully.

and startup the indesignserver, I founded that plug-ins count increased.

But, My javaScript could not connect app.sayHello() function.

what is the problem?

Thank you.

Views

1.4K

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
Explorer ,
Nov 19, 2008 Nov 19, 2008

Copy link to clipboard

Copied

It's dollyx bug.

you have to modify your resoure file like below.
dolly miss the "kInDesignServerAllLanguagesFS" .

resource VersionedScriptElementInfo(2)
{
// Contexts
{
// Scripting support added at InDesign CS 2.0
kFiredrakeScriptVersion, kCoreScriptManagerBoss, kInDesignAllLanguagesFS, k_Wild,
kFiredrakeScriptVersion, kCoreScriptManagerBoss, kInCopyAllLanguagesFS, k_Wild,
kFiredrakeScriptVersion, kCoreScriptManagerBoss, kInDesignServerAllLanguagesFS, k_Wild,
}

Have a good time..

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 ,
Feb 25, 2009 Feb 25, 2009

Copy link to clipboard

Copied

Hello,

This post was useful for me as I also developed a server plugin using Dollyxs. Then I modified my resoure file as suggested above.

Javascript file named "sayhello.js" is there which i run in a hope that plugin works.

Does, this js file should contain "app.sayhello()" ??? Or what is the way through which I can make this plugin do its job while running the sayhello.js file.

Reading this post, I tried putting "app.sayhello()" in the sayhello.js file, but got an error as "app.sayhello is not a function".

Kindly help...

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 ,
Feb 25, 2009 Feb 25, 2009

Copy link to clipboard

Copied

Also, please guide me in this issue.
My plugin (generated through Dollyxs) has an event "speak" as registered in the code.

does this mean that sayhello.js file should have "app.speak" which will be handled by the HandleEvent function of *ScriptProvider.cpp?

Also, speak function is not supported by Indesign server. So I tried registering another event in the code, so that calling that event in sayhello.js may be handled in plugin code.

Please help in clarifying the procedure.

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
Explorer ,
Feb 26, 2009 Feb 26, 2009

Copy link to clipboard

Copied

In sayHello.js
///

var said = "Hello";
app.consoleout("said = "+ said);

app.speak(said);

//
in ScriptProvider.cpp
//
ErrorCode Speak(
ISciptEventData * data, IScript* parant)
{
ErrorCode status = kFailure;

ScriptDara scriptData;
status = data->ExtractEventData(p_Said, scriptData);

if (status == kSuccess) {
PMString data;
status = scriptData.GetPMString(data);
}
return status;
}

you can get "Hello" in the varariable data.
Have a good luck

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 ,
Feb 26, 2009 Feb 26, 2009

Copy link to clipboard

Copied

Hello byung-wan Jung,

Thanks a lot for reply.The code snippets you have written above, is exactly what is written in my two files. But this code runs fine, when plugin is put into desktop Indesign application. Same code of lines don't work with server plugin(of same functionality) as 'speak' method is not recognized by the Indesign server.

In sayhello.js when we put 'app.speak(said); ', then server throws an error saying that speak is not function.

So I am looking, what should be done so that code runs fine in server as well.

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
Explorer ,
Feb 26, 2009 Feb 26, 2009

Copy link to clipboard

Copied

LATEST
Hello tjtj,

InDesign Server code same to InDesign Desktop code.
So, I think you have some problem in your code.

If you have created the source code from the dolly then
InDesign server not work.

You can find that problems and solutions .

Thank you.

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