SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Send JAL stmt (windowclickbutton) in a vbscrip

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Send JAL stmt (windowclickbutton) in a vbscrip
Author Message
Jim Malone



Joined: 23 Oct 2000
Posts: 23

Post Send JAL stmt (windowclickbutton) in a vbscript Reply with quote

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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7955

Post Re: Send JAL stmt (windowclickbutton) in a vbscrip Reply with quote

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 View user's profile Send private message
Jim Malone



Joined: 23 Oct 2000
Posts: 23

Post Re: Send JAL stmt (windowclickbutton) in a vbscrip Reply with quote

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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7955

Post Re: Send JAL stmt (windowclickbutton) in a vbscrip Reply with quote

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 View user's profile Send private message
Jim Malone



Joined: 23 Oct 2000
Posts: 23

Post Re: Send JAL stmt (windowclickbutton) in a vbscrip Reply with quote

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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7955

Post Re: Send JAL stmt (windowclickbutton) in a vbscrip Reply with quote

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 View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
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


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.