TRIGGERcmd
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. A McF
    A
    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 4
    • Best 0
    • Controversial 0
    • Groups 0

    A McF

    @A McF

    0
    Reputation
    435
    Profile views
    4
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    A McF Unfollow Follow

    Latest posts made by A McF

    • 32 Bit GUI TriggerCMD Editor

      Re: Is there a 32bit Agent for Windows available?

      As I run TriggerCMD on a 32Bit Windows 10 mini pc, I have written a small -simple 32Bit GUI TriggerCMD editor. I have made it available at the following link ...
      https://drive.google.com/drive/folders/1-7Kx2Qh6SMQIU2t0fybJ4aiefbc6e9Za?usp=sharing

      posted in General Discussion
      A
      A McF
    • RE: Open YouTube In Chrome, Search and Play Result Fullscreen

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

      posted in Windows
      A
      A McF
    • 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 '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
      `

      posted in Windows
      A
      A McF
    • Search And Play A Movie By Title, Subtitle or Random

      My code formatting in this post apparently suck! Oops.

      I could say:
      ' Hey Google tell trigger command movie with parameter die hard' the movie should be found and played.

      {
        "trigger": "Movie",
        "command": "PlayMovie.vbs",
        "ground": "foreground",
        "voice": "movie",
        "allowParams": "true"
      }
      

      Create PlayMovie.vbs with these contents:

      '*****************************************************************************
       ' Author:   Allan McFarlane (2018)
       ' Purpose:  Locates And Play First Movie Whose Title Or
       '           SubTitle Matches The Passed Parameter(s).
       '           If There Is No Parameter A Random Movie Is Played.
       ' Inputs:   Complete Or Partial Movie Title Or SubTitle, Or None.
       ' Returns:  Message Box Will Be Shown If No Match Was Found.
       ' Notes:    I Use MediaPlayerLite As A Player, It's Installer Offers To Install
       '	     Crapware That Can Be Declined When Installing.
       '	     All Movies Are Stored In A Single Folder Called 'Movies'.
       '           Each Movie File Is Stored In It's Own Folder In The Movies Folder.
       '           Searching Is Based Only On The Folder Name.
       '           Movie Year Should Not Be A Parameter.
       '           The Words 'The' And 'A' Can Be Used, But, Will Be Internally Dropped.
       '           Only The 'MP4' Encoded Video File Types Are Played By This Script.
       '
       '           Movie Folders Follow The Following Naming Conventions:
       '           Butterfly Effect 2, The (2006)
       '           Catwoman (2004)
       '           Poison Ivy 4 _ The Secret Society (2008)
       '           Pirates of the Caribbean 1 _ The Curse of the Black Pearl (2003)
       '           RoboCop REMAKE (2014)
       '           Simple Plan, A (1998)
       '           Spider-Man 2 (2004)
       '           Nine And A Half Weeks (1986)
       '*****************************************************************************
       ' root needs to be set as the path to the 'Movies' folder
      root = "\\GOFLEX_HOME\GoFlex Home Public\Movies\"
      
      For Each a In WScript.Arguments
      	arg = arg & a & " "
      Next 'a 
      
      arg = LCase(Trim(arg))
      
      If Left(arg, 4) = "the " Then 'discard superfluous leading THE from parameter
          arg = Right(arg, Len(arg) - 4)
          padding2 = 5
      ElseIf Left(arg, 2) = "a " Then 'discard superfluous leading A from parameter
          arg = Right(arg, Len(arg) - 2)
          padding2 = 3
      End If
      
      Set fso = CreateObject("Scripting.FileSystemObject")
      
      Set oFolders = fso.GetFolder(root) 'main folder that contains all sub folders, which contain the actual movie
      success = 0
      If arg <> "" Then
          For Each oFolder In oFolders.SubFolders 'loop through sub folder list
              padding = padding2
              If padding = 0 Then 'account for lenght of possible trailing text THE or A
                  If InStr(LCase(oFolder.Name), ", a") > 0 Then
                      padding = 3
                  End If
                  If InStr(LCase(oFolder.Name), ", the") > 0 Then
                      padding = 5
                  End If
              End If
              
              If InStr(oFolder.Name, "(") > 0 Then 'prepare for exclusion of trying to match release year ie: (2006)
                  padding = padding + 7
              End If
              
              subStart = 0
              subTitle = ""
              subStart = InStr(oFolder.Name, "_") 'test for existence of possible subtitle
              
              If subStart > 0 Then 'fetch simple title and subtitle if present
                  Title = LCase(Left(oFolder.Name, subStart - 1))
                  subTitle = LCase(Mid(oFolder.Name, subStart + 1, Len(oFolder.Name) - subStart - padding))
              Else
                  Title = LCase(oFolder.Name)
              End If
              
               'does this folder's title or subtile contains a match to the parameter?
              If InStr(Title, arg) > 0 Or InStr(subTitle, arg) > 0 Then
                  Set oFiles = oFolder.Files
                  For Each oFile In oFiles 'loop through filenames to find my MP4 encoded movie
                      If InStr(LCase(oFile.Name), ".mp4") > 0 Then
                          arg = root & oFolder.Name & "\" & oFile.Name 'build path to movie file
                          'build string for specific executable with compatible command line arguments
                          success = 1
                          arg = Chr(34) & "C:\Program Files\MediaPlayerLite\mpl.exe " & Chr(34) & " " & Chr(34) & arg & Chr(34) & " /fullscreen"
                          CreateObject("Wscript.Shell").Run arg 'run it!
                          Exit For
                      End If
                  Next
                  Exit For
              End If
          Next
      Else
          'No movie to search for, so play a random movie
          folderCount = oFolders.SubFolders.Count
          Randomize
          folderNum = Int((folderCount - 1 + 1) * Rnd + 1)
          curFolderNum = 0
          
          For Each oFolder In oFolders.SubFolders 'loop through sub folder list
              curFolderNum = curFolderNum + 1
              If curFolderNum = folderNum Then
                  Set oFiles = oFolder.Files
                  For Each oFile In oFiles 'loop through filenames to find the MP4 encoded movie
                      If InStr(LCase(oFile.Name), ".mp4") > 0 Then
                          arg = root & oFolder.Name & "\" & oFile.Name 'build path to movie file
                          'build string for specific executable with compatible command line arguments
                          success = 1
                          arg = Chr(34) & "C:\Program Files\MediaPlayerLite\mpl.exe " & Chr(34) & " " & Chr(34) & arg & Chr(34) & " /fullscreen"
                          CreateObject("Wscript.Shell").Run arg 'run it!
                          Exit For
                      End If
                  Next
                  Exit For
              End If
          Next
      End If
      
      Set fso = Nothing
      
      If success = 0 Then
          WScript.Echo "No Match Found!" & vbCrLf & arg
      End If
      
      posted in Windows
      A
      A McF