Yes, but notice my extra set of parens surrounding the second group. Since errorlevel and aaa are tested the same on both sides of the "or" with an "and" condition, it can be enclosed in it's own paren group seperated from the rest with an "and".boiler wrote: ↑23 May 2022, 11:43I believe some things are in there twice because it's two groupings of a series of "and"s that are separated by an "or". And it is desired that that part be true in either of the "or" segments. So I think it's actually meant to be in there twice for good reason. The things you took out of one side probably need to be true in that other side as well. To show the grouping with parentheses:(well, actually, the check2 part could come out, but I can see why !errorlevel is in there twice)Code: Select all
if (!errorlevel & winexist("ahk_exe this") && winexist("ahk_exe thisb") && aaa =1) or (!errorlevel && winexist("ahk_exe check2") && winexist("ahk_exe check2") && aaa=1)
BTW, you missed an "&" also.
Russ