RunHEScriptCom from javascript not return value

I have the hescript (UserMain):

function UploadXml: String;
begin
Result := OpenFileDialog(“Select a Xml to open”, “.xml", ".xml”, “XML files (.xml)|.xml”, “”);
end;

And i call this javascript funtion:

function uploadXML()
{
var xmlFilename = exeoutput.RunHEScriptCom(‘UserMain.UploadXml’, false);
alert(xmlFilename);
}

Its open the file windows (and i choose one file) but the alert shows “undefined”.

I use the chrome.
When i use ie and call “window.external.GetHEScriptCom(‘UserMain.UploadXml’, false)” works.

It’s a known problem that will be fixed. Chromium doesn’t work as expected when returning variables in JavaScript.
A workaround: store your filename to an ExeOutput’s global variable in your UploadXml function, and read the global variable with the corresponding JavaScript call.