sort
Shared by Marc
Script
function generate(s){
var temp = new Array();
temp = s.split('\n');
temp.sort();
var result = "";
var i;
for(i=0; i<temp.length; i++) {
result += temp[i] + "\n";
}
return result;
}
editor.setText(generate(editor.getText()))