v2.0-a079-be5df98 - not operator and Hotkey function
Posted: 21 Jun 2017, 06:40
Unlike the "!" operator, the "not" operator doesn't work. Is this intended?
The following example(s) from _If.htm:
throws the following error if I press NumpadAdd on the taskbar. Did I do something wrong here?
Edit: Ah sorry, wrong topic. I thought this refers to the new version generally, not just to the loop statements.
The following example(s) from _If.htm:
Code: Select all
; Example 1: Adjust volume by scrolling the mouse wheel over the taskbar.
#If MouseIsOver("ahk_class Shell_TrayWnd")
WheelUp::Send "{Volume_Up}"
WheelDown::Send "{Volume_Down}"
MouseIsOver(WinTitle) {
MouseGetPos ,, Win
return WinExist(WinTitle " ahk_id " Win)
}
; Example 4: Dynamic hotkeys. Requires Example 1.
NumpadAdd::
Hotkey "If", MouseIsOver("ahk_class Shell_TrayWnd")
if (doubleup := !doubleup)
Hotkey "WheelUp", "DoubleUp"
else
Hotkey "WheelUp", "WheelUp"
return
DoubleUp:
Send "{Volume_Up 2}"
return
Code: Select all
Error: Parameter #2 must match an existing #If expression.
Line#
003: Return
004: Send "{Volume_Down}"
004: Return
006: {
007: MouseGetPos "", "", "Win"
008: Return WinExist(WinTitle " ahk_id " Win)
009: }
---> 013: Hotkey "If", MouseIsOver("ahk_class Shell_TrayWnd")
014: if (doubleup := !doubleup)
015: Hotkey "WheelUp", "DoubleUp"
016: Else
017: Hotkey "WheelUp", "WheelUp"
018: Return
021: Send "{Volume_Up 2}"
022: Return
The current thread will exit.