TRIGGERcmd
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Youtube VBS help needed

    General Discussion
    1
    1
    509
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      PNick
      last edited by

      I wrote some VBS that opens the program I want:

      Dim objShell
      Set objShell = WScript.CreateObject( "WScript.Shell" )
      objShell.Run("""C:\Users\P_Nic\OneDrive\Desktop\apps\Awesome Tube""")
      Set WSS = CreateObject("Wscript.Shell")
      Wscript.sleep 6000
      WSS.sendkeys "{TAB}"
      Wscript.sleep 300
      WSS.sendkeys "{TAB}"
      Wscript.sleep 300
      WSS.sendkeys"{enter}"
      Set objShell = Nothing""
      

      I don't know how to set up the parameters I want to go into the search function. Here is some code that I threw together to accomplish a similar task:

      For Each a In WScript.Arguments
      param = param & a & " "
      Next 'a
      param = LCase(Trim(param))
      Set WSS = CreateObject("Wscript.Shell")
      arg = "https://www.google.ca/search?q=" & param & "site:youtube.com"
      strURL = Chr(34) & "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe " & Chr(34) & " " & Chr(34) & arg & Chr(34)
      WSS.Run strURL
      WSS.AppActivate "Google Chrome"
      Wscript.sleep 2000
      WSS.sendkeys "{TAB}"
      Wscript.sleep 300
      WSS.sendkeys "{TAB}"
      Wscript.sleep 300
      WSS.sendkeys "{TAB}"
      Wscript.sleep 300
      WSS.sendkeys "{TAB}"
      Wscript.sleep 300
      WSS.sendkeys "{TAB}"
      Wscript.sleep 300
      WSS.sendkeys "{TAB}"
      Wscript.sleep 300
      WSS.sendkeys "{TAB}"
      Wscript.sleep 300
      WSS.sendkeys "{TAB}"
      Wscript.sleep 300
      WSS.sendkeys "{TAB}"
      Wscript.sleep 300
      WSS.sendkeys "{TAB}"
      Wscript.sleep 300
      WSS.sendkeys "{TAB}"
      Wscript.sleep 300
      WSS.sendkeys "{TAB}"
      Wscript.sleep 300
      WSS.sendkeys "{TAB}"
      Wscript.sleep 300
      WSS.sendkeys "{TAB}"
      Wscript.sleep 300
      WSS.sendkeys "{TAB}"
      Wscript.sleep 300
      WSS.sendkeys "{TAB}"
      Wscript.sleep 300
      WSS.sendkeys "{TAB}"
      Wscript.sleep 300
      WSS.sendkeys "{TAB}"
      Wscript.sleep 300
      WSS.sendkeys "{TAB}"
      Wscript.sleep 7500
      WSS.sendkeys "+{f}"
      Set WSS = Nothing""
      

      I'm not good with coding, I just google and copy stuff that sounds right and trial and error until it does what I want. Any help would be appreciated!

      1 Reply Last reply Reply Quote 0
      • First post
        Last post