Hi,
I can't get the following button to work as it should.
This is how I want it to behave :
- IF there's something in the text field, then do a specific action
- IF the textfield is not filled and a button is clicked, then do the specific button action.
For some reason the If...Then....Else function does not see if there was something in the textfield or not.
Anyone can give me a helping hand on why it doesn't work please ? (Or a working script that does the trick ?)
Here's the script for the button :
'@script vbscript
' Create a Dialog object. You can also obtain dialog objects from the Lister, Tab, Func and Command objects.
Set dlg = DOpus.Dlg
' Initialise the object to display a simple message with three buttons.
dlg.message = "Select Stream Link to Play."
dlg.Window = DOpus.Listers(0)
dlg.title = "Dialog Title"
dlg.max = 128 ' enable the text field
dlg.buttons = "1 = realkraftyy (Twitch)|2 = Sacriel (Twitch)|3 = JackFrags (Twitch)|4 = Valientthor89 (Twitch)|5 = boogie2988 (Twitch)|6 = Vikkstar123 (Youtube)|7 = WeAreChange (Youtube)|8 = The Joy of Coding (Twitch)|9 = The Thinkery (Youtube)|10 = Bob Ross (Twitch)|Cancel"
dlg.defid = 0
ret = dlg.Show
Dim shell
' Show the dialog and print the result to the script log
If dlg.input <> Null Then
Set shell = CreateObject("WScript.Shell")
shell.Run """C:\Program Files (x86)\Streamlink\Releases\Streamlink.exe"" <contents of input field here> best"
DOpus.Output "The string you entered was " & dlg.input
Else
DOpus.Output "Text field remained empty"
DOpus.Output "Dialog.Show returned " & ret
' realkraftyy (Twitch)
If ret = "1" Then
' Dim shell
Set shell = CreateObject("WScript.Shell")
shell.Run """C:\Program Files (x86)\Streamlink\Releases\Streamlink.exe"" twitch.tv/realkraftyy best"
End If
' Sacriel (Twitch)
If ret = "2" Then
' Dim shell
Set shell = CreateObject("WScript.Shell")
shell.Run """C:\Program Files (x86)\Streamlink\Releases\Streamlink.exe"" twitch.tv/Sacriel best"
End If
' JackFrags (Twitch)
If ret = "3" Then
' Dim shell
Set shell = CreateObject("WScript.Shell")
shell.Run """C:\Program Files (x86)\Streamlink\Releases\Streamlink.exe"" twitch.tv/jackfrags best"
End If
' Valientthor89 (Twitch)
If ret = "4" Then
' Dim shell
Set shell = CreateObject("Wscript.Shell")
shell.Run """C:\Program Files (x86)\Streamlink\Releases\Streamlink.exe"" twitch.tv/valientthorr89 best"
End If
' boogie2988 (Twitch)
If ret = "5" Then
' Dim shell
Set shell = CreateObject("Wscript.Shell")
shell.Run """C:\Program Files (x86)\Streamlink\Releases\Streamlink.exe"" twitch.tv/boogie2988 best"
End If
' Vikkstar123 (Youtube)
If ret = "6" Then
' Dim shell
Set shell = CreateObject("Wscript.Shell")
shell.Run """C:\Program Files (x86)\Streamlink\Releases\Streamlink.exe"" youtube.com/channel/UCvwgF_0NOZe2vN4Q3g1bY-A best"
End If
' WeAreChange (Youtube)
If ret = "7" Then
' Dim shell
Set shell = CreateObject("Wscript.Shell")
shell.Run """C:\Program Files (x86)\Streamlink\Releases\Streamlink.exe"" youtube.com/channel/UChwwoeOZ3EJPobW83dgQfAg best"
End If
' The Joy of Coding (Twitch)
If ret = "8" Then
' Dim shell
Set shell = CreateObject("WScript.Shell")
shell.Run """C:\Program Files (x86)\Streamlink\Releases\Streamlink.exe"" twitch.tv/mikeconley_dot_ca best"
End If
' The Thinkery (Youtube)
If ret = "9" Then
' Dim shell
Set shell = CreateObject("WScript.Shell")
shell.Run """C:\Program Files (x86)\Streamlink\Releases\Streamlink.exe"" youtube.com/channel/UCpiCH7qvGVlzMOqy3dncA5Q best"
End If
' The Thinkery (Youtube)
If ret = "10" Then
' Dim shell
Set shell = CreateObject("WScript.Shell")
shell.Run """C:\Program Files (x86)\Streamlink\Releases\Streamlink.exe"" twitch.tv/bobross best"
End If
End If