I'm trying to make the below code work, it should behave as follow:
Press f1 > wait till either Notepad or My Documents is opened. Give relevant messagebox
Currently it almost works, but the messagebox will only appear upon seeing My Documents only after the Notepad messagebox has triggered first. I need it to be looking for whichever I enter first. Also sometimes the messagebox pops up twice, quickly after closing, how do I get this to just run once?
Any ideas how I can tweak this? Thanks in advance.
Code: Select all
f1::
settitlematchmode, 2
settimer, docs, -1
settimer, notepad, -1
;return
docs:
winwaitactive, ahk_class CabinetWClass
msgbox, docs
return
notepad:
winwaitactive, ahk_class Notepad
msgbox, Notepad
return