#1:: ; Win+1 hotkey. Change as desired. { ; Get current clipboard contents. myText := Clipboard ; Determine line ending. If no CRLF sequence is found, ; assume LF endings. Otherwise, assume CRLF endings. StringReplace, myText, myText, `r`n, `r`n, UseErrorLevel If ( ErrorLevel = 0 ) { LineEnding := "`n" } Else { LineEnding := "`r`n" } ; Replace all blank lines with a section character (§) to use ; as a delimiter. StringReplace, myText, myText, %LineEnding%%LineEnding%, §, All ; Sort using custom delimiter. Sort, myText, d§ ; Restore line endings. StringReplace, myText, myText, §, %LineEnding%%LineEnding%, All ; Place modified text back on the clipboard. Clipboard := myText } Return