JJ -- very cool. Simple, smart algorithm which is head-smackingly obvious... AFTER you presented it.
Thanks for sharing! On Sunday, October 16, 2022 at 10:34:51 AM UTC-7 jj wrote: > Considering that list indentation is a form of compression, this BBEdit > script *sort_and_merge_indented_list.applescript* > <https://gist.github.com/mixio/2a31288be50061f3350a119c24a88b49#file-sort_and_merge_indented_list-applescript> > decompresses > the list, sorts it with the shell `sort` command, and compresses it back > again. > In doing so, the indented list will be sorted, sub lists will be merged > and duplicates will be eliminated. > For sorting options (case insensitive, etc.) see the `sort` man page in > terminal and adapt the do shell script according to your needs. > This script work on the selection of the front document or on the whole > document if nothing is selected. Selected lines should cover whole > sub-lists appropriately to make sense. > By default the script accepts TAB or 4 SPACES indented lists but outputs > TAB indented lists. > If you'd prefer a final 4 SPACES indented list, change the `vIndentation` > variable. > > INSTALL > > Copy this script to ~/Library/Library/Application\ > Support/BBEdit/Scripts/sort_and_merge_indented_list.applescript > Call it from BBEdit's AppleScript menu. > > HTH, > > Jean Jourdain > > -- This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "[email protected]" rather than posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit> --- You received this message because you are subscribed to the Google Groups "BBEdit Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/290ec1f1-2300-4566-a8df-cae6cfae3cf5n%40googlegroups.com.
