Else If
This command is a Flow Command. This command is to be used inside an If statement to check for another condition if the first condition was not returned true.
This is an enhancement that helps avoid nesting If statements inside one other.
You can simply replace the Else node in an If statement with the Else If command.
Condition: The conditional statement which will determine whether the containing commands will run.
Example 1
if($exists(<innertext="Video Training in Ten Minutes or Less!">)) { then { click(<innertext=" Video Training in Ten Minutes or Less! ">, "Left Click", "No") } else if($exists(<innertext="UBot Studio Video Tutorials">)) { navigate("http://www.ubotstudio.com/resources", "Wait") click(<innertext=" Video Training in Ten Minutes or Less! ">, "Left Click", "No") } }
If the first exists qualifier in the if command returns false, the else if command runs.
The Else if command check to see if the phrase "UBot Studio Video Tutorials" is available on the page.
If it is, then the else if command navigates to the main resources web page and clicks the url for the Video tutorials webpage.
Example 2
You can use multiple else ifs by stacking them after the if then else, as seen in the example below.
The example below checks to see if the webpage is on google using the exist qualifier to check to see if the Gmail link is available.
If it is, the script will navigate to tumblr If not, the script moves on to the first else if. If the page is on the UBot Studio resources page, the script navigates to google If the page is on tumblr, then the script navigates to the UBot Studio resources page.
More if then elses can be added to check for other criteria.
define error1 { navigate("tumblr.com", "Wait") } define error2 { navigate("google.com", "Wait") } define error3 { navigate("ubotstudio.com/resources", "Wait") } if($exists(<innertext="Gmail">)) { then { error1() } else if($exists(<innertext="Video Training in Ten Minutes or Less!">)) { error2() } else if($exists(<id="fullscreen_post_bg">)) { error3() } }