Hi Pickory,
As Dirk_Becker rightly mentioned you will need to use the result param. In order to use it you will have to intepret the return data using the get functions of the ScriptData. Try the following to get a string value returned from your jsx code
ScriptRecordData arg;
ScriptData script;
IDFile f(PMString("Macintosh HD:Users:manan:Desktop:demo_script.jsx"));
script.SetFile(f);
ScriptData result;
PMString errorString;
InterfacePtr<IScriptManager> scriptManager(Utils<IScriptUtils>()->QueryScriptManager(kJavaScriptMgrBoss));
InterfacePtr<IScriptRunner> scriptRunner(scriptManager, UseDefaultIID());
Utils<IScriptUtils>()->DispatchScriptRunner( scriptRunner, script,
arg, result,
errorString, kTrue);
PMString retval;
result.GetPMString(retval);
CAlert::InformationAlert(retval);
result will be populated by the value that you return from your jsx code, based on its type use the appropriate Get method and you should be good.
P.S. :- Have you been able to use DispatchScriptRunner command passing the script as a string, i am not able to do that. If you did please share your code snippet
-Manan