WinActivate not triggering on normal IfWinExist

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
milkygirl90
Posts: 565
Joined: 10 Nov 2020, 21:22

WinActivate not triggering on normal IfWinExist

Post by milkygirl90 » 20 Apr 2021, 18:38

I want #e to activate the last-used windows explorer window if available, else open dropbox. However, the script below activates dropbox in windows explorer if not available, even though I have other explorer windows open in other directories.

Any idea why?

Code: Select all

				 #e::
If WinExist, ahk_class CabinetWClass
WinActivate, ahk_class CabinetWClass		 
							 Else 
							   Run, % Drive . ":\Dropbox"
							   		 				 RETURN

User avatar
mikeyww
Posts: 26945
Joined: 09 Sep 2014, 18:38

Re: WinActivate not triggering on normal IfWinExist

Post by mikeyww » 20 Apr 2021, 18:54

See proper syntax: WinExist, example #1.

User avatar
milkygirl90
Posts: 565
Joined: 10 Nov 2020, 21:22

Re: WinActivate not triggering on normal IfWinExist

Post by milkygirl90 » 20 Apr 2021, 20:03

mikeyww wrote:
20 Apr 2021, 18:54
See proper syntax: WinExist, example #1.
ah! thanks!

Post Reply

Return to “Ask for Help (v1)”