autohotkey's ControlClick,&Set Default not working?











up vote
0
down vote

favorite












I'm following this awesome AutoHotkeyScript and having difficulty getting the Set Default button to be clicked.



off topic: If you want to replicate, I had to change a few commands for detection of the Sound window to work, so here's where I currently am:



   Run mmsys.cpl
IfWinNotActive, Sound, , WinActivate, Sound,
WinWait,Sound ; Change "Sound" to the name of the window in your local language
ControlSend,SysListView321,{Down 1} ; This number selects the matching audio device in the list, change it accordingly
Sleep, 100
ControlClick, &Set Default; Change "&Set Default" to the name of the button in your local language
Sleep, 100
;ControlClick,OK


now, the AHK log shows this as executing:



109: {
110: toggle := !toggle
112: if toggle
114: Run,mmsys.cpl
115: IfWinNotActive,Sound,l
115: WinActivate,Sound (0.03)
116: WinWait,Sound (0.31)
119: ControlSend,SysListView321,{Down 1} (0.01)
120: Sleep,100 (0.11)
121: ControlClick,&Set Default; Change "&Set Default" to the name of the button in your local language
122: Sleep,100 (0.11)
124: }
125: if !toggle
138: }
139: Return (6.74)


but &Set Default isn't being clicked.
I've verified that the button name is, in fact, &Set Default.
I guess I could use ClassNN's Button2, but I'd like to know -why- this isn't working, not just hack my way through it.



Alternatively I can send [alt down]S[alt up] to set it as default, but again, that's hacking, and why isn't the simple ControlClick working?










share|improve this question


























    up vote
    0
    down vote

    favorite












    I'm following this awesome AutoHotkeyScript and having difficulty getting the Set Default button to be clicked.



    off topic: If you want to replicate, I had to change a few commands for detection of the Sound window to work, so here's where I currently am:



       Run mmsys.cpl
    IfWinNotActive, Sound, , WinActivate, Sound,
    WinWait,Sound ; Change "Sound" to the name of the window in your local language
    ControlSend,SysListView321,{Down 1} ; This number selects the matching audio device in the list, change it accordingly
    Sleep, 100
    ControlClick, &Set Default; Change "&Set Default" to the name of the button in your local language
    Sleep, 100
    ;ControlClick,OK


    now, the AHK log shows this as executing:



    109: {
    110: toggle := !toggle
    112: if toggle
    114: Run,mmsys.cpl
    115: IfWinNotActive,Sound,l
    115: WinActivate,Sound (0.03)
    116: WinWait,Sound (0.31)
    119: ControlSend,SysListView321,{Down 1} (0.01)
    120: Sleep,100 (0.11)
    121: ControlClick,&Set Default; Change "&Set Default" to the name of the button in your local language
    122: Sleep,100 (0.11)
    124: }
    125: if !toggle
    138: }
    139: Return (6.74)


    but &Set Default isn't being clicked.
    I've verified that the button name is, in fact, &Set Default.
    I guess I could use ClassNN's Button2, but I'd like to know -why- this isn't working, not just hack my way through it.



    Alternatively I can send [alt down]S[alt up] to set it as default, but again, that's hacking, and why isn't the simple ControlClick working?










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I'm following this awesome AutoHotkeyScript and having difficulty getting the Set Default button to be clicked.



      off topic: If you want to replicate, I had to change a few commands for detection of the Sound window to work, so here's where I currently am:



         Run mmsys.cpl
      IfWinNotActive, Sound, , WinActivate, Sound,
      WinWait,Sound ; Change "Sound" to the name of the window in your local language
      ControlSend,SysListView321,{Down 1} ; This number selects the matching audio device in the list, change it accordingly
      Sleep, 100
      ControlClick, &Set Default; Change "&Set Default" to the name of the button in your local language
      Sleep, 100
      ;ControlClick,OK


      now, the AHK log shows this as executing:



      109: {
      110: toggle := !toggle
      112: if toggle
      114: Run,mmsys.cpl
      115: IfWinNotActive,Sound,l
      115: WinActivate,Sound (0.03)
      116: WinWait,Sound (0.31)
      119: ControlSend,SysListView321,{Down 1} (0.01)
      120: Sleep,100 (0.11)
      121: ControlClick,&Set Default; Change "&Set Default" to the name of the button in your local language
      122: Sleep,100 (0.11)
      124: }
      125: if !toggle
      138: }
      139: Return (6.74)


      but &Set Default isn't being clicked.
      I've verified that the button name is, in fact, &Set Default.
      I guess I could use ClassNN's Button2, but I'd like to know -why- this isn't working, not just hack my way through it.



      Alternatively I can send [alt down]S[alt up] to set it as default, but again, that's hacking, and why isn't the simple ControlClick working?










      share|improve this question













      I'm following this awesome AutoHotkeyScript and having difficulty getting the Set Default button to be clicked.



      off topic: If you want to replicate, I had to change a few commands for detection of the Sound window to work, so here's where I currently am:



         Run mmsys.cpl
      IfWinNotActive, Sound, , WinActivate, Sound,
      WinWait,Sound ; Change "Sound" to the name of the window in your local language
      ControlSend,SysListView321,{Down 1} ; This number selects the matching audio device in the list, change it accordingly
      Sleep, 100
      ControlClick, &Set Default; Change "&Set Default" to the name of the button in your local language
      Sleep, 100
      ;ControlClick,OK


      now, the AHK log shows this as executing:



      109: {
      110: toggle := !toggle
      112: if toggle
      114: Run,mmsys.cpl
      115: IfWinNotActive,Sound,l
      115: WinActivate,Sound (0.03)
      116: WinWait,Sound (0.31)
      119: ControlSend,SysListView321,{Down 1} (0.01)
      120: Sleep,100 (0.11)
      121: ControlClick,&Set Default; Change "&Set Default" to the name of the button in your local language
      122: Sleep,100 (0.11)
      124: }
      125: if !toggle
      138: }
      139: Return (6.74)


      but &Set Default isn't being clicked.
      I've verified that the button name is, in fact, &Set Default.
      I guess I could use ClassNN's Button2, but I'd like to know -why- this isn't working, not just hack my way through it.



      Alternatively I can send [alt down]S[alt up] to set it as default, but again, that's hacking, and why isn't the simple ControlClick working?







      windows-7 autohotkey






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jul 23 '15 at 6:48









      paIncrease

      1696




      1696






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          0
          down vote













          doh, looks like it's a simple syntax problem:




          1. you don't need a semicolon at the end of every line

          2. you do need a space delimiter between the command and the semicolon.


          for example, WinWait, Sound; is a problem but WinWait, Sound ; is correct.






          share|improve this answer




























            up vote
            0
            down vote













            For ControlClick:
            I finally found my own solution after skimming the documentation more thoroughly:



            https://autohotkey.com/docs/commands/ControlClick.htm#Reliability



            You can specify NA as the sixth parameter to wait for the mouse button to lift.
            I found that when firing Control, Check, ,Button1 prior to ControlClick the click didn't work, but adding the NA to the end somehow magically fixed it. I suppose a click was being simulated and had not yet lifted.






            share|improve this answer








            New contributor




            adjenks is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.


















              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "3"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














               

              draft saved


              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f944150%2fautohotkeys-controlclick-set-default-not-working%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              0
              down vote













              doh, looks like it's a simple syntax problem:




              1. you don't need a semicolon at the end of every line

              2. you do need a space delimiter between the command and the semicolon.


              for example, WinWait, Sound; is a problem but WinWait, Sound ; is correct.






              share|improve this answer

























                up vote
                0
                down vote













                doh, looks like it's a simple syntax problem:




                1. you don't need a semicolon at the end of every line

                2. you do need a space delimiter between the command and the semicolon.


                for example, WinWait, Sound; is a problem but WinWait, Sound ; is correct.






                share|improve this answer























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  doh, looks like it's a simple syntax problem:




                  1. you don't need a semicolon at the end of every line

                  2. you do need a space delimiter between the command and the semicolon.


                  for example, WinWait, Sound; is a problem but WinWait, Sound ; is correct.






                  share|improve this answer












                  doh, looks like it's a simple syntax problem:




                  1. you don't need a semicolon at the end of every line

                  2. you do need a space delimiter between the command and the semicolon.


                  for example, WinWait, Sound; is a problem but WinWait, Sound ; is correct.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jul 23 '15 at 7:03









                  paIncrease

                  1696




                  1696
























                      up vote
                      0
                      down vote













                      For ControlClick:
                      I finally found my own solution after skimming the documentation more thoroughly:



                      https://autohotkey.com/docs/commands/ControlClick.htm#Reliability



                      You can specify NA as the sixth parameter to wait for the mouse button to lift.
                      I found that when firing Control, Check, ,Button1 prior to ControlClick the click didn't work, but adding the NA to the end somehow magically fixed it. I suppose a click was being simulated and had not yet lifted.






                      share|improve this answer








                      New contributor




                      adjenks is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.






















                        up vote
                        0
                        down vote













                        For ControlClick:
                        I finally found my own solution after skimming the documentation more thoroughly:



                        https://autohotkey.com/docs/commands/ControlClick.htm#Reliability



                        You can specify NA as the sixth parameter to wait for the mouse button to lift.
                        I found that when firing Control, Check, ,Button1 prior to ControlClick the click didn't work, but adding the NA to the end somehow magically fixed it. I suppose a click was being simulated and had not yet lifted.






                        share|improve this answer








                        New contributor




                        adjenks is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                        Check out our Code of Conduct.




















                          up vote
                          0
                          down vote










                          up vote
                          0
                          down vote









                          For ControlClick:
                          I finally found my own solution after skimming the documentation more thoroughly:



                          https://autohotkey.com/docs/commands/ControlClick.htm#Reliability



                          You can specify NA as the sixth parameter to wait for the mouse button to lift.
                          I found that when firing Control, Check, ,Button1 prior to ControlClick the click didn't work, but adding the NA to the end somehow magically fixed it. I suppose a click was being simulated and had not yet lifted.






                          share|improve this answer








                          New contributor




                          adjenks is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          For ControlClick:
                          I finally found my own solution after skimming the documentation more thoroughly:



                          https://autohotkey.com/docs/commands/ControlClick.htm#Reliability



                          You can specify NA as the sixth parameter to wait for the mouse button to lift.
                          I found that when firing Control, Check, ,Button1 prior to ControlClick the click didn't work, but adding the NA to the end somehow magically fixed it. I suppose a click was being simulated and had not yet lifted.







                          share|improve this answer








                          New contributor




                          adjenks is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          share|improve this answer



                          share|improve this answer






                          New contributor




                          adjenks is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          answered Nov 21 at 2:56









                          adjenks

                          1011




                          1011




                          New contributor




                          adjenks is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.





                          New contributor





                          adjenks is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.






                          adjenks is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.






























                               

                              draft saved


                              draft discarded



















































                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f944150%2fautohotkeys-controlclick-set-default-not-working%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              If I really need a card on my start hand, how many mulligans make sense? [duplicate]

                              Alcedinidae

                              Can an atomic nucleus contain both particles and antiparticles? [duplicate]