I am using Run Script command to run a vb script. The script runs fine when executed directly but doesn't even execute the first line of the script when called from the Run Script Command.
The script is for SAP GUI but this is not the only instance where this error comes up. I will attach the script for the reference.
WScript.Echo "hi"
If Not IsObject(application) Then
Set SapGuiAuto = GetObject("SAPGUI")
Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
Set connection = application.Children(0)
End If
If Not IsObject(session) Then
Set session = connection.Children(0)
End If
If IsObject(WScript) Then
WScript.ConnectObject session, "on"
WScript.ConnectObject application, "on"
End If
session.findById(wndp1]/usr/cntlCONTAINER/shellcont/shell).focusDate = "20220110"
session.findById("wndi1]/tbarB0]/btnu0]").press