Click the Save button located on the right toolbar in the Command Window.
In the Script Name window, enter a file name and then click the Save As button. The script file is saved to My Files > Scripts.