Currently, it appears that Text Substitutions are initially sorted by their “native” order, matching what is stored in:
~/Library/Application Support/Script Debugger 8/Text Substitutions.plist.
However, clicking on one of the column headers in the table view will sort them by:
...(whether the replacement is enabled)
Replace(alphabetically by the text to replace)
With(alphabetically by the replacement text)
After one of these headers is clicked, there doesn’t appear to be official way of going back to the “native” order. This is my preferred sort order, since it allows for logical groupings of substitutions.
After some digging, I eventually found that I can restore the native order by editing Script Debugger’s defaults store, but obviously this is far from ideal:
defaults delete com.latenightsw.ScriptDebugger8 "NSTableView Columns v3 ASTextSubstitutions"
defaults delete com.latenightsw.ScriptDebugger8 "NSTableView Sort Ordering v2 ASTextSubstitutions"
defaults delete com.latenightsw.ScriptDebugger8 "NSTableView Supports v2 ASTextSubstitutions"
This appears necessary even if you make manual changes to the Text Substitutions through the GUI or by directly editing the plist, since Script Debugger still remembers the last sorted column.
It would be great if one or both of the following features could be added to a future version of Script Debugger:
A way to (re-)sort the substitutions natively in the GUI. This could hopefully be as simple as displaying a column that has the index of the substitution, allowing the column header to be clicked.
An easier way to change the order of substitutions within the GUI, by allowing clicking & dragging. Currently, the only way to do this within the GUI is to delete & re-insert at specific points.
This one may be more work to implement & is less important, since it can be done with a plist editor (provided the GUI is showing the substitutions in native order). Just thought I’d add it in for posterity.