There must be a possibility to convert a CounterBox into a number. For example
CounterBox["Page", {FileNameTake[bookUrl], "someTag"}] The suggestion
book = NotebookOpen[bookUrl]; CurrentValue[NotebookSelection[book], {"CounterValue", "Chapter"}] does not work (if the cell is selected programmatically).
I don't know how to referene a cell with a special tag with CurrentValue, but I presume that wouldn't work either.
I don't know why I have the hint here that this question is "subjective"??
I would appreciate any help.

{}button above the edit window. The edit window help button?is also useful for learning how to format your questions and answers. You may also find this this meta Q&A helpful $\endgroup$CurrentValue[SelectedCells[], {"CounterValue", "Section"}]works fine, yet I don't know if that's the answer. The question is a little bit chaotic. $\endgroup$