- Joined
- Jun 28, 2011
- Messages
- 30
- Reaction score
- 0
Hi,
I'm trying to write some javascript that will check to see if a settings file exists so that I can use its contents later in the application. I have an external code execution block in the main flow and I pass the working directory to it as a parameter.
I have the following code:
But this fails and the 3CXIvrServer.log shows:
Any ideas how I fix my code to achieve this?
I'm trying to write some javascript that will check to see if a settings file exists so that I can use its contents later in the application. I have an external code execution block in the main flow and I pass the working directory to it as a parameter.
I have the following code:
Code:
function CheckFileExists()
{
var g_fso = new ActiveXObject("Scripting.FileSystemObject");
var path = arguments[0] + "\settings.ini";
if (g_fso.FileExists(path))
{
return "true";
}
else
{
return "false";
}
}
But this fails and the 3CXIvrServer.log shows:
Code:
Error! Module '3CX.com.OSBjsi'. Error ID 501. errmsgReferenceError: ActiveXObject is not definedline3linetxttokentxt
Any ideas how I fix my code to achieve this?