Youtube VBS help needed
-
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!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login