Sort by line length possible?

I’m curious if there is an action for sorting lines of text by length. I’m a teacher and i frequently need to write tests that involve multiple-choice questions where sorting possible answers by length from shortest to longest is desirable. Is there a way to do this in Drafts or an action that isn’t labeled as such but contains this feature? Thanks.

I whipped up a quick action for you to try.

It should sort selected lines (or if no lines selected, the whole draft), by length (descending), and then subsequently alphabetically - i.e. lines of the same length will be ordered alphabetically.

Hope that helps.


Wow, that works brilliantly—thank you very much @sylumer!