WinWaitActive doesn't detect Chrome printing dialog

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
Frigol
Posts: 5
Joined: 22 Sep 2022, 06:57

WinWaitActive doesn't detect Chrome printing dialog

Post by Frigol » 22 Sep 2022, 08:13

WinWaitActive doesn't detect the string "Chrome Legacy Window`r`nChrome Legacy Window`r`n" which is the identifier for the internal chrome printing dialog. I built a little workaround script which does the job. Is there a way to "convince" WinWaitActive to detect the printing window of chrome?

Code: Select all

		;chrome is opened
		SendInput "^p" ;print
		TextFix := "Chrome Legacy Window`r`nChrome Legacy Window`r`n"
		TextVar := ""
		Loop
		{
			Sleep 100
			WinWait "ahk_exe vivaldi.exe", , 1
			TextVar := WinGetText()
		}
		Until TextFix == TextVar ;check if print screen openend the second window
		;do something in the printing dialog

Return to “Ask for Help (v2)”