I don't understand the difference between Autohotkey's If
and If(...)
According to everything I have found, If(...)
behaves as "expected" but there is something not working with my code.
Below does not work. It seems the statement in the If
is never evaluated, %TimeString%
is never set and nothing is output:
CapsLock & T::
Input Key, L1
If (Key=T)
{
FormatTime, TimeString,, HHmm
}
Send %TimeString%
Below does work, %TimeString%
is set and the time is output.
CapsLock & T::
Input Key, L1
If Key=T
FormatTime, TimeString,, HHmm
Send %TimeString%