Open YouTube In Chrome, Search and Play Result Fullscreen
-
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.
-