Hotkey, If, Expression Problem

Get help with using AutoHotkey and its commands and hotkeys
alllala
Posts: 17
Joined: 03 Apr 2014, 05:04

Hotkey, If, Expression Problem

25 Aug 2014, 11:02

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
}
User avatar
Nextron
Posts: 1368
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win7 x64 AHK: Unicode x32

Re: Hotkey, If, Expression Problem

25 Aug 2014, 12:16

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
alllala
Posts: 17
Joined: 03 Apr 2014, 05:04

Re: Hotkey, If, Expression Problem

25 Aug 2014, 12:25

Thank you for the quick help. Now it´s obvious why it didn´t work in the first place.
guest3456
Posts: 2574
Joined: 09 Oct 2013, 10:31

Re: Hotkey, If, Expression Problem

25 Aug 2014, 12:48

best to post in the Ask For Help forum before Bug Reports


Return to “Ask For Help”

Who is online

Users browsing this forum: Cerberus, Google [Bot], nanotec89, rbinck, Rohwedder, SamSegal97, teadrinker, Trisolaris and 77 guests