 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
Jim Malone
Joined: 23 Oct 2000 Posts: 23
|
|
Send JAL stmt (windowclickbutton) in a vbscript |
|
I need to send the JAL stmt (windowclickbutton) from within a stand alone vbscript. Something like? 'Set Remote_24x7 = Creatobject("w24x7asp.vbRemote24x7") 'or Set Remote_24x7 = Creatobject("vb24x7.Process") objShell.AppActivate ("24x7 Scheduler Help",true) Remote_24x7.WindowGetActive (window_handle) Remote_24x7.WindowClickButton( window_handle, "Index" )
|
|
Wed Feb 01, 2006 3:03 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7955
|
|
Re: Send JAL stmt (windowclickbutton) in a vbscrip |
|
You are on the right track. Dim obj As Object Set obj = CreateObject("24x7 Remote Control") ' open session obj.OpenSession( "john_doe", "password", "WinSock", _ "LocalHost", "1096", "", False) Set Script = "Dim window_handle, number" & vbCrLf &_ "WindowGetActive (window_handle) " & vbCrLf &_ "WindowClickButton( window_handle, ""Index"" )" obj.RunScript( Script ) ' close session obj.CloseSession() ' destroy COM object Set obj = Nothing objShell.AppActivate ("24x7 Scheduler Help",true) : I need to send the JAL stmt (windowclickbutton) : from within a stand alone vbscript. : Something like? : 'Set Remote_24x7 = Creatobject("w24x7asp.vbRemote24x7") : 'or : Set Remote_24x7 = Creatobject("vb24x7.Process") : objShell.AppActivate ("24x7 Scheduler Help",true) : Remote_24x7.WindowGetActive (window_handle) : Remote_24x7.WindowClickButton( window_handle, "Index" )
|
|
Wed Feb 01, 2006 6:11 pm |
|
 |
Jim Malone
Joined: 23 Oct 2000 Posts: 23
|
|
Re: Send JAL stmt (windowclickbutton) in a vbscrip |
|
I'm receiving the following error: Windows Script Host --------------------------- Script: C:\Program Files\24x7 Automation 3\JAL Test.vbs Line: 22 Char: 5 Error: Object required: '[string: "Dim window_handle, n"]' Code: 800A01A8 Source: Microsoft VBScript runtime error Here is the code: sub Main Dim objShell, obj, window_handle, Scriptit Set obj = CreateObject("24x7 Remote Control") Set objShell = CreateObject("WScript.Shell") ' open session If obj.OpenSession ("", "XXXXX-XXXXXXX-XXXXX", "WinSock", "LocalHost", "1096", "", False) 1 then 'Error Msgbox obj.LastError Else Success=objShell.AppActivate ("24x7 Scheduler Help",true) Set Scriptit = "Dim window_handle, number" & vbCrLf &_ "WindowGetActive (window_handle) " & vbCrLf &_ "WindowClickButton (window_handle, ""Index"")" Obj.RunScript(Scriptit) End if End sub Main : I need to send the JAL stmt (windowclickbutton) : from within a stand alone vbscript. : Something like? : 'Set Remote_24x7 = Creatobject("w24x7asp.vbRemote24x7") : 'or : Set Remote_24x7 = Creatobject("vb24x7.Process") : objShell.AppActivate ("24x7 Scheduler Help",true) : Remote_24x7.WindowGetActive (window_handle) : Remote_24x7.WindowClickButton( window_handle, "Index" )
|
|
Thu Feb 02, 2006 5:19 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7955
|
|
Re: Send JAL stmt (windowclickbutton) in a vbscrip |
|
If obj.OpenSession ("", "XXXXX-XXXXXXX-XXXXX", "WinSock", "LocalHost", "1096", "", False) 1 then This should be changed to If obj.OpenSession ("", "XXXXX-XXXXXXX-XXXXX", "WinSock", "LocalHost", "1096", "", False) = -1 then : I'm receiving the following error: Windows Script Host : --------------------------- : Script: C:\Program Files\24x7 Automation 3\JAL Test.vbs : Line: 22 : Char: 5 : Error: Object required: '[string: "Dim window_handle, n"]' : Code: 800A01A8 : Source: Microsoft VBScript runtime error : Here is the code: sub Main : Dim objShell, obj, window_handle, Scriptit : Set obj = CreateObject("24x7 Remote Control") : Set objShell = CreateObject("WScript.Shell") : ' open session : If obj.OpenSession ("", "XXXXX-XXXXXXX-XXXXX", : "WinSock", "LocalHost", "1096", : "", False) 1 then : 'Error : Msgbox obj.LastError : Else : Success=objShell.AppActivate ("24x7 Scheduler Help",true) : Set Scriptit = "Dim window_handle, number" & vbCrLf &_ : "WindowGetActive (window_handle) " & vbCrLf &_ : "WindowClickButton (window_handle, ""Index"")" : Obj.RunScript(Scriptit) : End if : End sub : Main
|
|
Thu Feb 02, 2006 5:54 pm |
|
 |
Jim Malone
Joined: 23 Oct 2000 Posts: 23
|
|
Re: Send JAL stmt (windowclickbutton) in a vbscrip |
|
I beleive due to a editor color issue the ' ' b/4 the '1' did not appear. The problem is with the following code...what is wrong? Set Scriptit = "Dim window_handle, number" & vbCrLf &_ "WindowGetActive (window_handle) " & vbCrLf &_ "WindowClickButton (window_handle, ""Index"")" sub Main Dim objShell, obj, window_handle, Scriptit Set obj = CreateObject("24x7 Remote Control") Set objShell = CreateObject("WScript.Shell") ' open session If obj.OpenSession ("", "XXXXX-XXXXXXX-XXXXX", "WinSock", "LocalHost", "1096", "", False) 1 then 'Error Msgbox obj.LastError Else Success=objShell.AppActivate ("24x7 Scheduler Help",true) Set Scriptit = "Dim window_handle, number" & vbCrLf &_ "WindowGetActive (window_handle) " & vbCrLf &_ "WindowClickButton (window_handle, ""Index"")" Obj.RunScript(Scriptit) End if End sub Main Set Scriptit = "Dim window_handle, number" & vbCrLf &_ "WindowGetActive (window_handle) " & vbCrLf &_ "WindowClickButton (window_handle, ""Index"")" : If obj.OpenSession ("", "XXXXX-XXXXXXX-XXXXX", : "WinSock", "LocalHost", "1096", : "", False) 1 then : This should be changed to : If obj.OpenSession ("", "XXXXX-XXXXXXX-XXXXX", : "WinSock", "LocalHost", "1096", : "", False) = -1 then
|
|
Thu Feb 02, 2006 7:44 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7955
|
|
Re: Send JAL stmt (windowclickbutton) in a vbscrip |
|
I belive SET makes the VBscript engine consider Scriptit variable as an object while it is a simple variable Dim Scriptit Scriptit = "blah...blah...blah" : I beleive due to a editor color issue the ' ' b/4 the '1' did : not appear. : The problem is with the following code...what is wrong? : Set Scriptit = "Dim window_handle, number" & vbCrLf &_ : "WindowGetActive (window_handle) " & vbCrLf &_ : "WindowClickButton (window_handle, ""Index"")" : sub Main : Dim objShell, obj, window_handle, Scriptit : Set obj = CreateObject("24x7 Remote Control") : Set objShell = CreateObject("WScript.Shell") : ' open session : If obj.OpenSession ("", "XXXXX-XXXXXXX-XXXXX", : "WinSock", "LocalHost", "1096", : "", False) 1 then : 'Error : Msgbox obj.LastError : Else : Success=objShell.AppActivate ("24x7 Scheduler Help",true) : Set Scriptit = "Dim window_handle, number" & vbCrLf &_ : "WindowGetActive (window_handle) " & vbCrLf &_ : "WindowClickButton (window_handle, ""Index"")" : Obj.RunScript(Scriptit) : End if : End sub : Main : Set Scriptit = "Dim window_handle, number" & vbCrLf &_ : "WindowGetActive (window_handle) " & vbCrLf &_ : "WindowClickButton (window_handle, ""Index"")"
|
|
Fri Feb 03, 2006 10:32 am |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|