-
Re: Open YouTube in default broswer and query search term
The following VBScipt code will accept a search term as a parameter, select and follow a link from the search results, and play the video fullscreen. My web browser is Google Chrome.
`
For Each a In WScript.Arguments
param = param & a & " "
Next 'aparam = 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\Google\Chrome\Application\chrome.exe " & Chr(34) & " " & Chr(34) & arg & Chr(34)WSS.Run strURL
WSS.AppActivate "Google Chrome"
Wscript.sleep 2000WSS.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 300WSS.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 300WSS.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 300WSS.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 300WSS.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 300WSS.sendkeys"{enter}"
Wscript.sleep 7500WSS.sendkeys "+{f}"
Set WSS = Nothing
` -
@a-mcf NOTE: The path to Chrome broweser in the code, is that of the 32Bit version and would be different on a 64Bit machine.
-
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