To save a script as a Script Editor file:

Choose File > Save.

Choose a location to save your file.

In the Save dialog, choose “script” from the File Format pop-up menu.

Enter a name for the script (.scptd is the filename extension).

Click Save.
You can save a script as a compiled script that can be run by double-clicking it in the Finder.
Important: You will not be able to edit this script again if you choose Run Only in the save dialog. If you want to be able to change the script, be sure to save the run-only version as a copy with a different name and retain the original in the standard editable format.
Choose File > Save.
Choose a location to save your file.
In the Save dialog, choose “script” from the File Format pop-up menu.
Enter a name for the script (.scptd is the filename extension).
Click Save.
To save the script in a noneditable format, select the checkbox labeled Run Only.