Language Guide

CHAPTER 2
Overview of AppleScript
30 Other Features and Language Elements
Compiling Scripts With the Script Editor 2
When you create or modify a script and then attempt to run or save it as a
compiled script or script application, the Script Editor asks AppleScript to
compile the script first. To compile a script, AppleScript converts the script
from the form typed into a Script Editor window (or any script-editing
window) to a form that AppleScript can execute. AppleScript also attempts to
compile the script when you click the Script Editor’s Check Syntax button.
If AppleScript compiles the script successfully, the Check Syntax button is
dimmed and the Script Editor reformats the text of the script according to the
preferences set with the AppleScript Formatting command (in the Edit menu).
This may cause indentation and spacing to change, but it doesn’t affect the
meaning of the script. If AppleScript can’t compile the script because of syntax
errors or other problems, the Script Editor displays a dialog box describing the
error or, if you are trying to save the script, allowing you to save the script as a
text file only.