Look ahead with Execute Until

When using the KM action

Execute until a certain condition is met,

and the condition is the presence or absence of a

Found image

should you look for the found image in the present window or the next window following after the condition is satisfied?

I'm entirely clear on what you're asking. But the main difference between an "Until" and a "While" is that an "Until" will always execute its contained Actions at least once while a "While" may not execute them at all. That should be your main consideration on which to choose.

So an "Until" will

  1. Do the Actions contained within it
  2. Check the Conditions
  3. Depending on 2, either loop again or exit the loop and continue with the macro

Any "Found Image" Condition will be tested at the end of the loop, using whatever criteria you choose, against the "state" after the Actions in the loop have executed -- if, for example, you had a bunch of images open in separate windows and your loop brought the rearmost window to the front every time, an "in the front window" test would work through your windows in reverse stacking order until the image was found.