I fixed my script already but seems a bit weird for me. I think there is another way to execute the block and not using 2 try and 2 catch.
Or is there something I can add to completely ignore the error if the window can't be closed?
Code: Select all
#notrayicon
SetTimer Label, 250
Label()
{
try
{ WinClose "ahk_class CreativeView ahk_exe TeamViewer.exe"
WinClose "Gesponserte Sitzung ahk_class #32770 ahk_exe TeamViewer.exe"
}
catch
{
}
}
Persistent
Code: Select all
#notrayicon
SetTimer Label, 250
Label()
{ try
WinClose "ahk_class CreativeView ahk_exe TeamViewer.exe"
catch
try
WinClose "Gesponserte Sitzung ahk_class #32770 ahk_exe TeamViewer.exe"
catch
return
}
Persistent