Applescript If Then statements are used as control statements i.e. some piece of code will run only in case certain conditions are met. Each if statement works as Boolean value that is used to evaluate a particular expression as either true or false. The commands which are written in the if statement block, they are executed only if the Boolean returns the true value. If statements ends with an end if.
if amountReceived < 1000 then
set memberStatus to “General”
set memberStatus to “Special”
In the above piece of code, if the Boolean returns true (the amountReceived is less than 1000) then the instructions inside the if statement are executed. And if the Boolean returns false, then those instructions are not executed. In that case, the control is shifted to the else portion and the instructions of else statement will be executed. This combination is known as an if-then-else statement.
In the end, Applescript If Then else is easy to learn. However, practicing it by yourself makes you more clear not only about the control statements but also about development of varying programming skills in your own self.