I have a script, which is working, but could be far more elegant. What it’s purpose is, is to sort the words on a line after the “:”. I use this for keywords in documents. For example:
keywords: red yellow green blue
will sort to
keywords: blue green red yellow
The following script works, as long as my prefix is “keywords: “ what I would like to do is make it more elegant to sort only what comes after the “:” regardless of the tag.
// Alpha sort selected lines.
var lnRange = editor.getSelectedLineRange();
var wd = editor.getTextInRange(10,lnRange);
var words = dw.split(’ ‘).sort();
Edit: Actually turns out my brute force did not work, it’s messing up lines before the selected line. Back to the drawing board.