メインコンテンツまでスキップ
バージョン:25.4

else

Keyword

if ... else, else if

Examples:

If imagefound("on")
Click foundimagelocation() -- Clicks the location where the previous image "on" was found
else
Click "off"
end if
if imageFound(image:"DashHome",waitFor:0)
Click "DashHome"
else if imageFound(image:"StartHome",waitFor:0)
TypeText WindowsKey,"r"
WaitFor 8, "RunLine"
else
throw "Image not found", "Desktop not visible." -- Throws an exception if neither of the two conditions are met
end if

(if ... else ...) selector expression

Example:

set age to (if years >= 100 then "centuries" else "many years")

Further Reading

Resources in our other reference manuals.

*If Then Else

Related terms in the SenseTalk Dictionary.

*if *then