To sort alphabetically you need to select the range of cells and in the script define the value of the ascending parameter to TRUE. This will short the words in the column in alphabetical order. You can refer to the example script in the “Google sheets auto sort multiple columns” section.