Is there any documentation for the /run/beamOn optional macro file?

I’ve got a problem where I would like to turn on some diagnostic info for a specific event deep in a run (event number 1.7 million or so). In Aug 2020, I asked this same question (Example of within-event macro file with /run/beamOn?) but got no useful reply.

The full syntax of the /run/beamOn command is:

/run/beamOn <nEvents> [event-macro] [nSelect]

where event-macro is a G4 UI macro file which will be called for each of the first [nSelect] events (or all events).

I would like to know whether the current event number is available to event-macro. If so, how do I access it (an alias? /control/getVal? Something else?

There is no documentation for this anywhere in the Application Developers Guide (or any of the other documentation). There is no example that uses this optional feature.

A second specific question – when is the macro called? Is it called before the start of the event, or is it called at the end of the event? I’m trying to use the optional event-macro to turn on tracking verbosity for just specific events, but it’s not working. I put a /control/echo line in, and it appears to be getting called after the event finishes. Is that correct?