For Eggplant to see an image that is only displayed briefly on the screen is a challenge, and may not be possible to do reliably (every time) if the image only appears for a small fraction of a second. To do this, you’ll need to temporarily reduce or eliminate some of Eggplant’s built-in delays. You may also need to set the SearchRectangle to a small area of the screen, so that Eggplant doesn’t waste time searching all of the screen. I see that you’ve set a SearchRectangle when clicking Image1 in your second code example, but this should be done for Image2 if it is the image that only appears briefly.
Something like this might do what you need:
put the imageSearchDelay into ISD -- remember this
set the imageSearchDelay to 0.01
put the remoteWorkInterval into RWI -- remember this
set the remoteWorkInterval to 0.01
Click "Image1"
If imageFound(5, (imageName:"Image2", SearchRectangle: tempSearchRect)) then
Log "Image2 Found"
else
LogError "Image2 Not Found"
end if
set the remoteWorkInterval to RWI -- restore this
set the imageSearchDelay to ISD -- restore this
Note that it’s important to restore the timing delays to their normal values after this search so as not to impact the functioning of the rest of your script.
The ImageFound() function in the example above will search the screen for 5 seconds waiting for Image2 to appear before it will fail (and return false). The tempSearchRect should be set to a relatively small rectangle to focus the search on the area where Image2 will appear.
Good luck, and let us know how this works for you!