If and Else Basics

Hello. I’m doing something obviously wrong here… IF an image is present I want eggplant to run one snippet of code if it isn’t then I want it to run something else… thought I had it…

if imageFound(“FunctionsLog”) then

(
DoubleClick "IE7"
)

else
(
Click "BlueDesktop"	
     )

end if

Why the parens?
-edj

Doh.

if imageFound(“FunctionsLog”) then

DoubleClick "FunctionsLog"

else

Click "BlueDesktop"	

end if

Hello, Bass-O-Matic!

What exactly is failing about this code? It looks good to me, once you removed the parens :wink:

The only thing I would do differently is this:

if imageFound("FunctionLog") 
    doubleClick foundImageLocation()
else 
     doubleClick "IE7"

end if
the only real difference is the foundImageLocation() which makes your script run considerably faster as it doesn’t search for the same image a bunch of times.