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

    Open YouTube In Chrome, Search and Play Result Fullscreen

    Windows
    2
    3
    3.4k
    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.
    • A
      A McF
      last edited by

      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 '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\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 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"{enter}"
      Wscript.sleep 7500

      WSS.sendkeys "+{f}"
      Set WSS = Nothing
      `

      A 1 Reply Last reply Reply Quote 0
      • A
        A McF @A McF
        last edited by

        @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.

        1 Reply Last reply Reply Quote 0
        • Royher FigueraR
          Royher Figuera
          last edited by

          @A-McF / @russ I'm interest in this script but I don't know how start. I made a file .vbs with your code but won´t run and I don´t know how configure triggercmd with that. I supose the trigger is the file and the param is "the search". I´m correct?

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