Your script needs to be compiled before it can be run or saved if it has been modified since the last time it was run or saved.
An Editor preference, “Show compiled state in gutter,” causes a script that needs compiling to display a striped “barberpole” pattern in the gutter.
To compile your script, you can:
Compile your code explicitly. To do so:
Press Enter (different from pressing Return).
Or, choose Script > Compile.
Or, click Compile in the script window toolbar.
Run the script. The script will automatically be compiled first.
A script that cannot be compiled cannot be run.
Save the script. When you save a script that needs compiling to a compiled script file format, the script will automatically be compiled first.
A script that cannot be compiled cannot be saved as a compiled script file.
If your script can’t be compiled because it isn’t valid AppleScript code, you’ll get an error message.
To force your script to recompile even if it doesn’t need compiling, hold down the Option key and choose Script > Recompile (or click Recompile in the toolbar). This will also re-initialize persistent top-level entities to their base values.
After a successful compilation, the script window displays the word “Compiled” in the status bar.