Is there a way to programmatically reorder the section cells in a notebook alphabetically?
For example:

Is there a way to programmatically reorder the section cells in a notebook alphabetically?
For example:

I will try to add a more general function later, meanwhile you can use this procedure:
Module[{cells, data},
cells = Cells[CellStyle -> "Section"];
data = (
SelectionMove[#, All, CellGroup, AutoScroll -> False];
NotebookRead[EvaluationNotebook[]]
) & /@ SortBy[cells, First@NotebookRead[#] &];
Do[
SelectionMove[cells[[i]], All, CellGroup, AutoScroll -> False];
NotebookWrite[EvaluationNotebook[], data[[i]], AutoScroll -> False]
,
{i, Length@cells}
]
]
Cell["Python", "Section", WholeCellGroupOpener->True]
– M.R.
Jun 16 '15 at 17:30
CellContext: 102269 so you can use this replacement rules.
– Kuba
Dec 22 '15 at 07:32