I'd like to get a clickable list of all "Sections" that have been recently modified in my notebook, grouped by day of modification. "Modified" Section means, some cell under that Section heading has been modified.

The following gives the list of most recently modified cells, but I'd like this to point to the "Section" object instead of the actual cell, I guess this needs some kind of traversal up the cell hierarchy, any tips?

notebookCellData = 
   ResourceSystemBase -> 
   EvaluationNotebook[], {"CellChangeTimes"}], #CellChangeTimes &], 
  • 1
    $\begingroup$ replace EvaluationNotebook[] with Cells[CellStyle -> "Section"]? $\endgroup$
    – kglr
    Dec 2, 2023 at 1:28

1 Answer 1


You can find the section containing a given cell by using the {"CounterValue", "Section"} current value. Leveraging this idea produces:

cellButton[cell_] := Button[RawBoxes @ NotebookRead[cell], SelectionMove[cell, All, Cell]]

ModifiedSections[date_:0] := Module[{sections=Cells[CellStyle->"Section"], data, abs = AbsoluteTime[date]},
    data = Cases[
        Thread[{Max/@CurrentValue[Cells[], CellChangeTimes], Cells[], CurrentValue[Cells[], {"CounterValue","Section"}]}],
        {s_, c_, i_?Positive} /; s>abs :> {s, c, sections[[i]]}
    CreateWindow @ PaletteNotebook @ Dataset @ Reverse @ KeySort @ GroupBy[
        DayRound @* First -> Rest, 
        GroupBy[#, cellButton @* Last -> First, Column]&

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.