SetTitleMatchMode, Regex

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
euras
Posts: 429
Joined: 05 Nov 2015, 12:56

SetTitleMatchMode, Regex

22 Nov 2017, 08:52

Why IfWinExist or WinActivate works with SetTitleMatchMode, Regex while Winwait doesn't work? It must share the same principles, but for some reasons it doesn't work or I cannot find how to force it to work..

Code: Select all

SetTitleMatchMode, Regex
IfWinExist, Privat ITP file.*1
	WinWait, Privat ITP file.*2 ; the code just skips that line, doesn't react to winwait or winwaitactive. I want to force the tool wait until the new file will appear.
; the full name of file can be Privat ITP file (2015)2 - Excel or Privat ITP file (2015)1 - Excel 
Hiney

Re: SetTitleMatchMode, Regex

24 Nov 2017, 15:10

euras wrote:anybody?
can you use winwaitactive instead?
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: SetTitleMatchMode, Regex

24 Nov 2017, 15:55

Maybe you need the window criteria to be a little more specific:
Privat ITP file (2015)1 - Excel
Privat ITP file (2015)2 - Excel
Both of your original window criteria, match both of those window titles, because the number 2015 contains both 1 and 2. Perhaps this will work:

Code: Select all

SetTitleMatchMode, RegEx
IfWinExist, Privat ITP file.*1 -
	WinWait, Privat ITP file.*2 -
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
euras
Posts: 429
Joined: 05 Nov 2015, 12:56

Re: SetTitleMatchMode, Regex

27 Nov 2017, 04:58

for some reasons this method works..

Code: Select all

if (t = 1 or t = 2){
      SetTitleMatchMode, Regex
      IfWinNotExist, Privat flyttefil.*1
      {
         SetTitleMatchMode, Regex
         WinWait, Privat flyttefil.*1
      }
      SetTitleMatchMode, Regex
      IfWinExist, Privat flyttefil.*1
      {
         SetTitleMatchMode, Regex
         WinWait, Privat flyttefil.*2
      }
   }

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: haomingchen1998 and 251 guests