VoiceGuide IVR Software Main Page
Jump to content

Vbscript Syntax

Recommended Posts

I would lke to use the VBS module to check if prompt1.wav exists.

If YES then I want to go back to the vg.vgs module for further processing

If NO then I want to go back to the vg.vgs module for further processing

 

Could someone please check/correct the code snippet to achieve the desired result.

__________________________________________________________________________

 

Set objFSO = CreateObject("Scripting.FileSystemObject")

 

If objFSO.FileExists("C:\Program Files\VoiceGuide\Scripts\Prompts\prompt$RV[Get Numbers].wav") Then

vg.Script_Goto "C:\Program Files\VoiceGuide\Scripts\Prompts\Prompt Menu.vgs", "Play Prompt"

Else

vg.Script_Goto "C:\Program Files\VoiceGuide\Scripts\Prompts\Prompt Menu.vgs", "EvaluateDigitsFail"

End If

 

 

Share this post


Link to post

For VoiceGuide v7 use:

 

set vg = CreateObject("vgServices.CommandLink")
set objFSO = CreateObject("Scripting.FileSystemObject")


If objFSO.FileExists("C:\Program Files\VoiceGuide\Scripts\Prompts\prompt$RV[Get Numbers].wav") Then
 vg.Script_Goto "C:\Program Files\VoiceGuide\Scripts\Prompts\Prompt Menu.vgs", "Play Prompt", ""
Else
 vg.Script_Goto "C:\Program Files\VoiceGuide\Scripts\Prompts\Prompt Menu.vgs", "EvaluateDigitsFail", ""
End If

set vg = Nothing
set objFSO = Nothing

 

See: http://www.voiceguide.com/vghelp/source/html/com_script_goto.htm

Share this post


Link to post

It looks like the module [Run VB Script Digits] is not set to wait for the VBScript to return.

 

If you want to let the ran VBScript to return data to VoiceGuide and have VoiceGuide act on that data then you need to select the "Wait until script completes" option.

 

Please see http://www.voiceguide.com/vghelp/source/html/modvbs.htm - setion "Wait until script completes option"

 

If you still encounter issues please post the script used along with the traces.

Share this post


Link to post

Looking at the VBScript again, it appears to have some issues as well. $RV_LINEID is missing.

 

Please see: http://www.voiceguide.com/vghelp/source/html/com_script_goto.htm

 

The script should be:

 

set vg = CreateObject("vgServices.CommandLink")
set objFSO = CreateObject("Scripting.FileSystemObject")


If objFSO.FileExists("C:\Program Files\VoiceGuide\Scripts\Prompts\prompt$RV[Get Numbers].wav") Then
 vg.Script_Goto $RV_LINEID, "C:\Program Files\VoiceGuide\Scripts\Prompts\Prompt Menu.vgs", "Play Prompt", ""
Else
 vg.Script_Goto $RV_LINEID, "C:\Program Files\VoiceGuide\Scripts\Prompts\Prompt Menu.vgs", "EvaluateDigitsFail", ""
End If

set vg = Nothing
set objFSO = Nothing

 

All the code ran from "Run VBScript" type modulas is saved as .vbs files in VoiceGuide's \temp\ subdirectory.

You can test how that VBScript runs by just double clicking on relevant file. Any errors tht VBScript would have will then show is a displayed dialog box.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×