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

Calling jsx to c++

Participant ,
Jul 07, 2020 Jul 07, 2020

Copy link to clipboard

Copied

Hi,

 

I have tried this code to fetch the image count values from javascript to c++. But it doesn't provide the desired values.Please guide me for working on this..

 

InterfacePtr<IScriptManager> scriptManager(Utils<IScriptUtils>()->QueryScriptManager(kJavaScriptMgrBoss));
InterfacePtr<IScriptRunner> scriptRunner(scriptManager, UseDefaultIID());
PMString importscript;
importscript.Append("var imagecount = app.activeDocument.allGraphics.length;");
importscript.Append("var images =app.scriptArgs.setValue(\"imagecount\",String(imagecount));");

importscript.Append("alert(String(images));");

PMString engineName("myengine");
int32 errorCode = Utils<IExtendScriptUtils>()->RunScriptInEngine(engineName, importscript);
Utils<IScriptArgs>()->Clear();

 

Regards,

-Monisha
TOPICS
How to

Views

95

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
no replies

Have something to add?

Join the conversation