title: "end if"/"else if" in AppleScript not working?
body: <p>I am trying to code an AppleScript with a dialog box that has multiple buttons, which each execute different commands. My problem is that AppleScript Editor detects either "end if" or "else if" as a syntax error, as per the title.</p>
  
  <p>For example:</p>
  
  <pre><code>set dialog to display dialog "Test" buttons {"1","2"}
  set pressed to button returned of dialog
  if pressed is equal to "1" then activate "Safari"
  else if pressed is equal to "2" then beep
  end if
  </code></pre>
  
  <p>AppleScript Editor displays the error "<b>Syntax Error</b>: Expected end of line, etc. but found “else if”."</p>
  
  <p>Is there something I'm doing wrong?</p>