I am making an AutoHotKey script so that I have media keys on my media key-less keyboard.
All of the shortcuts are working but i want to make one that will set the volume to max, unless it is already, in which case it would set it to 10.
Here is my script as it is:
SoundGet, master_volume
^!Down::SendInput {Media_Play_Pause}
^!Left::SendInput {Media_Prev}
^!Right::SendInput {Media_Next}
^!Up::SendInput {Media_Stop}
^!+Down::SendInput {Volume_Mute}
^!+Left::SendInput {Volume_Down}
^!+Right::SendInput {Volume_Up}
^!+Up::if (%master_volume% = 100) {
SoundSet, 10
} else {
SoundSet, 100
}
But I keep getting the error "Error: The following variable name contains an illegal character: "100.000000"" (the 100.000000 is what my volume is set to, e.g. if it's set to half maximum, it'll read 50.000000) and it highlights "if (%master_volume% = 100)" line ...
I'm pretty new to AutoHotKey, but I have read through a lot of (what I thought were) relevant docs and can't figure it out