problem with multiple #If

Get help with using AutoHotkey and its commands and hotkeys
b0bi
Posts: 6
Joined: 07 Apr 2016, 13:11

problem with multiple #If

21 Oct 2017, 03:48

I'm trying to get this to work

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus





The problem is:
It doesn't really check if active window is really Notepad... As soon as on_top=1 and I press "a", it triggers.... Any way to make it respct both condiction (logical and) ?
b0bi
Posts: 6
Joined: 07 Apr 2016, 13:11

Re: problem with multiple #If

21 Oct 2017, 03:54

solved !!!



Code: [Select all] [Download] GeSHi © Codebox Plus

#If on_top=1 and WinActive("ahk_class OneNote")

a::
MsgBox, Triggered
return



#If
SirRFI
Posts: 279
Joined: 25 Nov 2015, 16:52

Re: problem with multiple #If

21 Oct 2017, 06:25

Yes, You can't nest #If, because it replaces the last one used. Code flow doesn't affect it, unlike regular If.
Use [code=autohotkey] forum tag to share your code.
Click on (Accept this answer) on top-right part of the post if it has answered your question / solved your problem.

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], dametocorazon and 37 guests