If (Compound Statement)
A compound If statement contains one or more Boolean expressions and groups of statements to be executed if the value of the corresponding Boolean expression istrue
.SYNTAX
if Boolean [ then ] [ statement ]... [ else if Boolean [ then ] [ statement ]...]... [ else [ statement ]...] end [ if ]whereBoolean is an expression whose value is
true
orfalse
.statement is any AppleScript statement.
EXAMPLE
In the following If statement, the statements that copy an individual's status report to the end of a department status report are executed only if the date is March 1, 1993.
if Current Date = "March 1, 1993" tell application "Scriptable Text Editor" open file "Status Report" set myStatus to text from paragraph 1 to ÿ paragraph 10 of document "Status Report" close document "Status Report" open file "Department Status" copy myStatus to end of document "Department Status" close document "Department Status" end tell end if