I have been trying to write a simple script that opens up the windows sound settings and Disables/Enables my speakers, so that I can switch between my headphones and speakers with a key press.
So far I have:
Code: Select all
*F6::
Run, mmsys.cpl
WinWait,Sound
; Press the down key twice to select my speakers
ControlSend,SysListView321,{Down 2}
; Open the options for my speakers and press down 3 times to highlight disable
Send {AppsKey}{Down 3}
Send {Enter}
ControlClick,OK
return
Code: Select all
*F6::
Run, mmsys.cpl
WinWait,Sound
; Press the down key twice to select my speakers
ControlSend,SysListView321,{Down 2}
; Open the options for my speakers and press down twice, if the highlighted option is "Enable", send enter, otherwise press down one more time and send enter
ControlClick,OK
return
I have not used ahk before and any help would be appreciated!
Thanks