How to specify a window title that is more than one word? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
redrum
Posts: 100
Joined: 25 Jan 2015, 22:57

How to specify a window title that is more than one word?

14 Oct 2019, 09:12

This hotkey searches for a window title, activates the window if found, and sends a keystroke. If I search for only one word in the window title, the script works fine:

Code: Select all

!+x::
IfWinExist, Word1
	{	
		WinActivate  ; 
		Send, {Space}  
		return
	}	
return
But I don't know how to search for multiple words in the window title. I tried the following, but none of these worked:

Code: Select all

IfWinExist, "Word1 Word2"

Code: Select all

IfWinExist, ("Word1 Word2")

Code: Select all

IfWinExist, ('Word1 Word2')
MannyKSoSo
Posts: 440
Joined: 28 Apr 2018, 21:59

Re: How to specify a window title that is more than one word?  Topic is solved

14 Oct 2019, 09:18

https://www.autohotkey.com/docs/commands/WinExist.htm Should help some.
I recommend that you use If WinExist("Longer Title With Space") as the way you are using it is the depreciated version.
The depreciated version you would simply just place a space as the divider between each part is a comma and you wouldn't need quotes (https://www.autohotkey.com/docs/commands/WinExist.htm#Examples_7)
redrum
Posts: 100
Joined: 25 Jan 2015, 22:57

Re: How to specify a window title that is more than one word?

14 Oct 2019, 09:36

Thanks @MannyKSoSo, that works great. Thanks also for the link. I didn't realize I was using a deprecated form of WinExist.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], Marium0505 and 343 guests