On the Script tab, in the Macro Commands group: Select Utilities | Exit to quit the application. You will be prompted to save any modified documents.
The EXIT macro function is also accessible in the Macro Editor by selecting Macro | Exit from the Process menu.