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

    Autohotkey script for Play, Pause, Volume Up/Down, Next/Previous

    Windows
    10
    34
    24.0k
    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.
    • C
      Concretesurfer
      last edited by Concretesurfer

      Hey Russ,

      I have been having trouble with this. I tried getting the directory right but it either cant find the file without using "" or it just opens a CMD with the directory as the title and does not execute code.

      Does the directory have to use \ before the media.ahk and can this be in another directory separate from the C:Drive?

      I am new to this program and cant seem to get the AHK scripts working yet.

      RussR 1 Reply Last reply Reply Quote 0
      • RussR
        Russ @Concretesurfer
        last edited by

        @concretesurfer, this might be the issue:

        When I wrote "start C:\\autohotkeyscripts\\media.ahk stop" above, the context was the commands.json file, but if you're using the GUI Editor, you can skip the double \\'s.

        Just use "start C:\autohotkeyscripts\media.ahk stop" in the GUI Editor.

        Or "start G:\autohotkeyscripts\media.ahk stop", if you're using the G: drive.

        Russell VanderMey

        C 1 Reply Last reply Reply Quote 0
        • C
          Concretesurfer @Russ
          last edited by

          @russ It works now! It must have been the spaces in my directory.

          RussR 1 Reply Last reply Reply Quote 0
          • RussR
            Russ @Concretesurfer
            last edited by

            @concretesurfer, awesome. Yea if you have spaces you need quotes around your path.

            Russell VanderMey

            1 Reply Last reply Reply Quote 0
            • SailorEffinMoonS
              SailorEffinMoon
              last edited by

              First off, I apologize for any stupid things I may say I'm a noob to such things. I'm just trying to learn new and different ways I can control things with Alexa 🙂

              I got autohotkey, made the script and made sure all commands are linked to the correct script. It didn't do anything even when I'd trigger it manually. I tried running the script and it just gives me an error "Target label does not exist" for "Gosub, %1%.

              Did I miss something or do it wrong?

              RussR 1 Reply Last reply Reply Quote 0
              • RussR
                Russ @SailorEffinMoon
                last edited by Russ

                @sailoreffinmoon, I get that "Target label does not exist" for "Gosub, %1%." error if I run the ahk script with no parameter.

                So maybe you just need to add one of the parameters, like mute to the command line.

                Example command:

                start C:\autohotkeyscripts\media.ahk mute
                

                EDIT: I just learned that some scripts require you to run the AutoHotKey.exe directly instead of using "start", so the command would be:

                "C:\Program Files\AutoHotkey\AutoHotkey.exe" C:\autohotkeyscripts\media.ahk mute

                Russell VanderMey

                1 Reply Last reply Reply Quote 0
                • RussR
                  Russ
                  last edited by

                  Another way to play/pause is to simulate pressing the space bar with a command like this:
                  wscript c:\scripts\space.vbs

                  The contents of c:\scripts\space.vbs would look like this:

                  Dim Wsh
                  Set Wsh = Wscript.CreateObject("Wscript.Shell")
                  Wsh.SendKeys "{ }"
                  

                  Russell VanderMey

                  1 Reply Last reply Reply Quote 0
                  • ChabeticoC
                    Chabetico
                    last edited by

                    So, I tell alexa to execute this command but open cmd and say that she couldn't find such a directory. I tried to do without the "start" at the beginning but nothing happens. If you can help me I would appreciate it, I am new to this branch of TriggerCMD, I started yesterday to tell the truth. sorry about my English

                    ChabeticoC 1 Reply Last reply Reply Quote 0
                    • ChabeticoC
                      Chabetico @Chabetico
                      last edited by

                      @Chabetico I tested it and triggercmd does not execute the command, I sent him to write a letter through AHK, but nothing came out

                      RussR 1 Reply Last reply Reply Quote 0
                      • RussR
                        Russ @Chabetico
                        last edited by

                        @Chabetico, please show me the command you're having TRIGGERcmd run.

                        You might need to specify the full path of the AutoHotkey.exe and your script, so your command would look like this:

                        "C:\Program Files\AutoHotkey\AutoHotkey.exe" "C:\autohotkeyscripts\yourscript.ahk"

                        Russell VanderMey

                        ChabeticoC L 2 Replies Last reply Reply Quote 0
                        • ChabeticoC
                          Chabetico @Russ
                          last edited by

                          This post is deleted!
                          ChabeticoC 1 Reply Last reply Reply Quote 0
                          • ChabeticoC
                            Chabetico @Chabetico
                            last edited by

                            This post is deleted!
                            1 Reply Last reply Reply Quote 0
                            • L
                              Laaderlappen @Russ
                              last edited by

                              @Russ Hey, awesome skill to use with Alexa, I set it up with routines and it works like a charm!

                              I can manage to pause and play YouTube and Netflix without any issues but I run Plex Media Player from my PC as well and it can't pause or play Plex at all, do you know how can I achieve that? It's the only thing that I'm missing.

                              It's like it is not recognizing the play and pause command.

                              I wanted to try with space but don't know how to set it up.

                              RussR 1 Reply Last reply Reply Quote 0
                              • RussR
                                Russ @Laaderlappen
                                last edited by Russ

                                @Laaderlappen, I use Plex alot myself. I just tested space and it was able to play/pause on my PC. There are a few ways, but this is how I did it.

                                This is my command:

                                wscript d:\tools\space.vbs
                                

                                These are the contents of my d:\tools\space.vbs file:

                                Dim Wsh
                                Set Wsh = Wscript.CreateObject("Wscript.Shell")
                                Wsh.SendKeys "{ }"
                                

                                Russell VanderMey

                                L 1 Reply Last reply Reply Quote 0
                                • L
                                  Laaderlappen @Russ
                                  last edited by

                                  @Russ Thanks for the quick reply!

                                  Unfortunately it doesn't work.

                                  It doesn't even pauses YouTube or Netflix.

                                  I use the Plex Media Player app.

                                  The regular pause command is working with YouTube and Netflix in the browser but the Plex Media Player app that has its own .exe doesn't recognize anything.

                                  RussR 1 Reply Last reply Reply Quote 0
                                  • RussR
                                    Russ @Laaderlappen
                                    last edited by

                                    @Laaderlappen, I see. I was using Plex in the browser yesterday, but I tried Plex for Windows today and it worked for me in that too.

                                    I tried Plex for Windows version 1.11.0.1215-1d8c460c and the latest from this page which is currently 1.31.1.2262-74fdc6b7:

                                    https://www.plex.tv/media-server-downloads/#plex-app

                                    Both worked for me.

                                    Please confirm the Ground field is set to foreground.

                                    bdfcc56c-61b9-479b-9538-5cfa6fd4565c-image.png

                                    Russell VanderMey

                                    L 1 Reply Last reply Reply Quote 0
                                    • L
                                      Laaderlappen @Russ
                                      last edited by

                                      @Russ Sorry for the delay replying! Though week!

                                      I ended up installing my Mi Box in my bedroom, I needed the remote control haha.

                                      It didn't work, tried everything and nothing.

                                      Thanks for the quick replies tho!

                                      1 Reply Last reply Reply Quote 0
                                      • Sori _S
                                        Sori _
                                        last edited by Sori _

                                        @Russ I really liked your skill, but I wanted to know how I can, go back and continue videos on youtube/netflix with alexa's voice command, because when I use the command a message appears on my PC "windows cannot find C://autohotkeyscripts//media.ahh. make sure the name was typed correctly and try again.
                                        PS: I'm very beginner so could you explain to me how to use the codes that are at the top of the page?

                                        RussR 1 Reply Last reply Reply Quote 0
                                        • RussR
                                          Russ @Sori _
                                          last edited by

                                          @Sori-_, you'll need to:

                                          • Install AutoHotkey
                                          • Create a autohotkeyscripts folder on your 😄 drive
                                          • Create the media.ahk script in that folder.
                                          • Create commands like these:
                                          "C:\Program Files\AutoHotkey\AutoHotkey.exe" "C:\autohotkeyscripts\media.ahk" mute
                                          
                                          "C:\Program Files\AutoHotkey\AutoHotkey.exe" "C:\autohotkeyscripts\media.ahk" play
                                          

                                          Russell VanderMey

                                          Sori _S William Santiago Ortiz TrejosW 3 Replies Last reply Reply Quote 0
                                          • Sori _S
                                            Sori _ @Russ
                                            last edited by Sori _

                                            This post is deleted!
                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post