xcode user script - Apple Script - Sort selected lines by length
- by Bach
I need to create a user scripts in xcode where I can sort a selection of multiple lines, by their length (number of characters)
I know of this macro variable PBXTextLength, but not sure how to write the script.
this is the sort selection script in Xcode:
echo -n "%%%{PBXSelection}%%%"
sort <&0
echo -n "%%%{PBXSelection}%%%"
how can i modify that script to sort the selection by the length of the line (PBXTextLength)?
thanks