Have you ever had to sort a set of paragraphs in InDesign? Word lists, catalogue, phonebook, index entries, whatever. Problem is, the application lacks a “paragraph sorter”, you have to reorder your items from the outside. Then you lose local formattings. Wouldn't it be nicer to have such a tool integrated in InDesign?

SmartSort is a pure paragraph sorter, that is, it actually reorders text elements without altering any formatting or style attribute that may exist at the character scale. The script just rearranges the target paragraphs “as they are.” The algorithm works fast because it optimizes the number of individual moves.

SmartSort reordering a few paragraphs…

The first time you execute SmartSort.jsx from the Scripts panel, it automatically installs an item “Smart Sort…” in the Type submenu. You can also access it from the contextual menu by right-clicking over a text selection.

SmartSort's menu item.

Note. — Since the script is localized in distinct languages, the caption of the menu item will depend on your system (“Smart Sort…” being the default title.) It becomes “Tri intelligent…” in French, “Intelligente Sortierung…” in German, “Clasificación inteligente…” in Spanish, “Ordinamento intelligente…” in Italian, “Умная сортировка…” in Russian.

SmartSort can act on any text selection. It then targets all paragraphs that contain the selection (at least two paragraphs are required, of course.) You can also select a text frame, a cell, a footnote, etc. If your target is a text frame, the entire story is processed (incl. overset texts.)

Quick Note on the Collation Algorithm

SmartSort is built upon our IdExtenso framework and it uses a special module, Collator, which implements advanced collation options so you can alphabetize words with respect to different language conventions. This is a crucial feature when it comes to sorting non-English words based on characters or diacritics of foreign alphabets.

SmartSort's dialog provides a huge set of options.

The script supports more than 220 languages (mainly Latin, Greek, and Cyrillic alphabets) and will likely achieve decent collations in most InDesign locales, excluding CJK languages (which Collator doesn't address for the time being.)

Keep in mind that SmartSort is a free script, delivered in beta. Some refinements may come in the next releases regarding sort and collation options.