Page 1 of 1

Hotkey, If, Expression Problem

Posted: 25 Aug 2014, 11:02
by alllala
I´m trying to increase the priority of an Hotkey. Unfortunately I can´t get it to work. I only get this Errormessage. Anyone an idea, what I´m doing wrong?

---------------------------
Test.ahk
---------------------------
Error: Parameter #2 must match an existing #If expression.

Line#
---> 012: Hotkey,If,!Basic_MouseIsOver("Total Commander,NL Hold'em,Google Earth,overlay,Remote Desktop Connection,Civilization V,Warcraft III,Autodesk AutoCAD 2014", "#32770", "TV_REMOTEDESKTOP_CLASS1")
013: Hotkey,Rbutton,,P10
017: MsgBox
018: Return
023: {
026: ListLines,OFF
027: MouseGetPos,,,MouseIsOver_ID,MouseIsOver_Control
028: if Control

The program will exit.
---------------------------
OK
---------------------------

Code: Select all

#SingleInstance 

Hotkey, If, !Basic_MouseIsOver("Total Commander,NL  Hold'em,Google Earth,overlay,Remote Desktop Connection,Civilization V,Warcraft III,Autodesk AutoCAD 2014", "#32770", "TV_REMOTEDESKTOP_CLASS1")
Hotkey, Rbutton, , P10

#If !Basic_MouseIsOver("Total Commander,NL  Hold'em,Google Earth,overlay,Remote Desktop Connection,Civilization V,Warcraft III,Autodesk AutoCAD 2014", "#32770", "TV_REMOTEDESKTOP_CLASS1")
Rbutton:
msgbox
return
#if



Basic_MouseIsOver(WinTitle:="", WinClass:="", Control:="", ExcludeTitle:="") {
	global
	local Class, Title
	ListLines, OFF
	MouseGetPos,,, MouseIsOver_ID, MouseIsOver_Control
	If Control
		If MouseIsOver_Control contains %Control% 
			return true
	If WinClass
	{
		WingetClass, Class, ahk_id %MouseIsOver_ID%
		If Class contains %Winclass% 
			return true
	} 	
	if WinTitle
	{
		WingetTitle, Title, ahk_id %MouseIsOver_ID%
		If Title contains %WinTitle% 
			return true 
	}
	return false
}

Re: Hotkey, If, Expression Problem

Posted: 25 Aug 2014, 12:16
by Nextron
Escape all the comma's and add a colon to your Rbutton:

Code: Select all

Hotkey, If, !Basic_MouseIsOver("Total Commander`,NL  Hold'em`,Google Earth`,overlay`,Remote Desktop Connection`,Civilization V`,Warcraft III`,Autodesk AutoCAD 2014"`, "#32770"`, "TV_REMOTEDESKTOP_CLASS1")
Hotkey, Rbutton, , P10

#If !Basic_MouseIsOver("Total Commander,NL  Hold'em,Google Earth,overlay,Remote Desktop Connection,Civilization V,Warcraft III,Autodesk AutoCAD 2014", "#32770", "TV_REMOTEDESKTOP_CLASS1")
Rbutton::
msgbox
return
#if

Re: Hotkey, If, Expression Problem

Posted: 25 Aug 2014, 12:25
by alllala
Thank you for the quick help. Now it´s obvious why it didn´t work in the first place.

Re: Hotkey, If, Expression Problem

Posted: 25 Aug 2014, 12:48
by guest3456
best to post in the Ask For Help forum before Bug Reports

Re: Hotkey, If, Expression Problem

Posted: 26 Aug 2014, 03:17
by HotKeyIt
Moved to Ask For Help.