View Single Post
Old 03-06-2018, 11:35 PM
bighalo bighalo is offline
Registered User
Join Date: Mar 2018
Posts: 4
#$language = "VBScript"
#$interface = "1.0"

g_vWaitFors = Array("Waiting for 1", "Waiting for 2")

Sub Main()
Set objTab = crt.GetScriptTab

If objTab.Session.Connected <> True then
crt.Dialog.MessageBox _
Exit Sub
end if

objTab.Screen.Synchronous = true

nIndex = objTab.Screen.WaitForStrings(g_vWaitFors)
if nIndex = 1 then
result = crt.Dialog.MessageBox("gotcha","gotcha", ICON_STOP Or BUTTON_OK Or DEFBUTTON1 )
if result = IDNO then
exit sub
end if
end if
End Sub

This is my code. After the script is running in loop. When the screen get the "WaitForStrings". The messagebox will be shown. If I click OK then exit sub. But the script is still running. I don't want the script running again. What I can do is "Script/Cancel menu" to end the script. Is there any easy way to end running script.
Reply With Quote