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

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

Windows
10
34
24.8k
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.
  • R
    Russ @drosenth
    last edited by Russ Mar 4, 2018, 10:47 PM Mar 4, 2018, 10:41 PM

    @drosenth,

    I think the Autohotkey commands would work if you used VNC to connect to the console instead of using RDP.

    Autohotkey is simulating keystrokes which I think are blocked because RDP somehow knows there's no actual keyboard. Maybe it's a Windows security feature.

    Nice job getting the 32bit agent to work. Not everyone can figure that out.

    Russell VanderMey

    1 Reply Last reply Reply Quote 0
    • D
      drosenth
      last edited by Mar 11, 2018, 1:49 PM

      Russ,

      THANKS for the quick response - I should have followed-up back when I read this response. I will give VNC a try. The strange thing is even with just a minimized RDP window the AHK commands won't fire. It needs to be visible. But I will try VNC as if I get this working your product solves one of my biggest home automation issues!

      Again, AWESOME product! So very well thought out and versatile - professional all the way!!!

      Thanks,
      Dave R

      R 1 Reply Last reply Mar 11, 2018, 2:47 PM Reply Quote 0
      • R
        Russ @drosenth
        last edited by Mar 11, 2018, 2:47 PM

        Thank you @drosenth !

        I appreciate the feedback.

        Russell VanderMey

        1 Reply Last reply Reply Quote 0
        • D
          drosenth
          last edited by Mar 17, 2018, 3:09 PM

          Russ,

          Great news - A simple search of AHK and RDP turned up others having the same issue. I'll find a workaround, for sure, and thanks again FOR AN AWESOME PRODUCT!!

          Your solution is a best kept secret!!! Get the word out!! You have truly taken a great idea and developed nice add-on components that make if very usable (example, the Alexa piece is simple and cool, plus your subscription model - nice).

          So, again, thanks and great work. I will figure this out.

          And if you ever compile your code for Win7 32bit I would be glad to test. The GUI would be nice, but it works great as-is.

          Thanks,
          DaveR

          Link to AHT and RDP issue:

          https://autohotkey.com/board/topic/26749-running-ahk-with-remote-desktop-minimized/

          R 1 Reply Last reply Mar 17, 2018, 10:11 PM Reply Quote 0
          • R
            Russ @drosenth
            last edited by Mar 17, 2018, 10:11 PM

            Thank you @drosenth. I'll take any help I can get spreading the word.

            Russell VanderMey

            1 Reply Last reply Reply Quote 0
            • U
              username6
              last edited by Mar 18, 2018, 8:32 AM

              Hi Russ, thanks for this.

              I spent the last 5 hours setting up AHK commands for Kodi control and now I'm curious about backing up my triggers.

              On a Windows machine, does backing up the AppData folder suffice?

              If I reformat my PC or accidentally remove a trigger, will the triggers be saved in the cloud? Is there a way to make a backup of them? I created 120 of them and I really don't want to have to do that all again should the worst happen haha.

              Regards.

              R 1 Reply Last reply Mar 18, 2018, 10:01 PM Reply Quote 0
              • R
                Russ @username6
                last edited by Mar 18, 2018, 10:01 PM

                @username6, good question. You take a copy of commands.json in the .triggercmddata folder in your profile folder (c:\users\username\.triggercmddata).

                Russell VanderMey

                1 Reply Last reply Reply Quote 0
                • C
                  Concretesurfer
                  last edited by Concretesurfer May 11, 2018, 7:39 PM May 11, 2018, 6:01 PM

                  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.

                  R 1 Reply Last reply May 11, 2018, 9:45 PM Reply Quote 0
                  • R
                    Russ @Concretesurfer
                    last edited by May 11, 2018, 9:45 PM

                    @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 May 12, 2018, 12:45 AM Reply Quote 0
                    • C
                      Concretesurfer @Russ
                      last edited by May 12, 2018, 12:45 AM

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

                      R 1 Reply Last reply May 12, 2018, 2:07 AM Reply Quote 0
                      • R
                        Russ @Concretesurfer
                        last edited by May 12, 2018, 2:07 AM

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

                        Russell VanderMey

                        1 Reply Last reply Reply Quote 0
                        • S
                          SailorEffinMoon
                          last edited by Jul 31, 2018, 12:28 PM

                          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?

                          R 1 Reply Last reply Aug 1, 2018, 4:48 PM Reply Quote 0
                          • R
                            Russ @SailorEffinMoon
                            last edited by Russ Jul 30, 2020, 12:46 AM Aug 1, 2018, 4:48 PM

                            @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
                            • R
                              Russ
                              last edited by Aug 20, 2020, 1:04 AM

                              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 May 8, 2021, 4:23 AM

                                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 May 8, 2021, 4:37 AM Reply Quote 0
                                • ChabeticoC
                                  Chabetico @Chabetico
                                  last edited by May 8, 2021, 4:37 AM

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

                                  R 1 Reply Last reply May 8, 2021, 4:36 PM Reply Quote 0
                                  • R
                                    Russ @Chabetico
                                    last edited by May 8, 2021, 4:36 PM

                                    @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 May 8, 2021, 5:24 PM Reply Quote 0
                                    • ChabeticoC
                                      Chabetico @Russ
                                      last edited by May 8, 2021, 5:24 PM

                                      This post is deleted!
                                      ChabeticoC 1 Reply Last reply May 8, 2021, 5:31 PM Reply Quote 0
                                      • ChabeticoC
                                        Chabetico @Chabetico
                                        last edited by May 8, 2021, 5:31 PM

                                        This post is deleted!
                                        1 Reply Last reply Reply Quote 0
                                        • L
                                          Laaderlappen @Russ
                                          last edited by May 10, 2021, 7:58 PM

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

                                          R 1 Reply Last reply May 11, 2021, 10:47 PM Reply Quote 0
                                          • First post
                                            Last post