I am using DispatchScriptRunner to call some jsx code. I would like the jsx code to return a value to my C plugin. While opening the InDesign it shows an error message as no such file exist in the path.Whether I should modifies this code. Please guide me.
IDFile f(PMString("Desktop:sample script.jsx"));
InterfacePtr<IScriptRunner> scriptRunner(scriptManager, UseDefaultIID());
Utils<IScriptUtils>()->DispatchScriptRunner(scriptRunner, script,arg, result,errorString, kTrue);
} while (false);
Well, where is the script (jsx) file exactly?
I have placed the jsx file in the desktop and hereby I'll attach the exact location (C:\Users\Nithu Sathish\Desktop)
IDFile f(PMString("C:\\Users\\Nithu Sathish\\Desktop\\sample_script.jsx"));
Paths are platform dependent, the code snippet that you copied was written for a MAC and hence used a HFS path notation, even then you messed the path while editing it. HFS path starts with Macintosh HD: but you have removed all that so this is never gonna fly.
If you have to run this code on WIN the path changes as per WIN conventions. Atleast read the sdk documentation.
I am a beginner to develop plugin in indesign.
I need to pass a result from JSX code to C++ plugin code.
I know jsx but i don't know what write in jsx to pass te result.
There is nothing special to write on the jsx end, you need to return the value as you normally do. Handling the return value has to be done on the C++ plugin end. I have written a sample snippet of C++ code for getting the string return value from jsx in the following post, have a look at it