, - , , .
:
nb = CreateDocument[{
Cell["My Title", "Title"],
Cell["My first section", "Section"],
Cell["My second section", "Section"],
Cell[TextData[{"Section ",
CounterBox["Section"]}], "Section"]}];
, .
SelectionMove[nb, After, Notebook];
SelectionMove[nb, Previous, Cell];
.
cnt = sectionCnt = c = 0;
While[True, Print[c];
c = NotebookRead[nb];
If[c === {}, Break[]];
If[c[[2]] == "Section", sectionCnt++];
cnt++;
SelectionMove[nb, Previous, Cell]];
sectionCnt . , :
Do[SelectionMove[nb, Next, Cell], {cnt}]