1
votes

I'm trying to select my audio devices with AHK and right now I have something like this:

Run, mmsys.cpl
WinWait,Sound
ControlSend,SysListView321,{Down 1}

The first line works fine and the sound dialog appears but the ControlSend part doesn't seem to do anything. Does anyone have any idea why? I expect it to select the top entry by hitting the down key.. I'm running on Windows 10 if that helps at all.

1
could you try including a Sleep just after Run, mmsys.cpl to make sure it is waiting for the Sound window. The code works fine for me - Arun Thomas

1 Answers

0
votes

try this,

Run, mmsys.cpl
Loop{
    IfWinExist Sound
    {
        ControlSend,SysListView321,{Down 1}
        break
    }
}

your code works for me, but for you i think the issue is with the WinWait. If it is, then the above mentioned code will work for you