Get the ID rather than the phase number when scripting

Hello!

This might be a real simple question but I cannot seem to find any solution online

When writing scripts and per the examples available on the website - the results often are presented as for example : Phase 3, max moment 45 knm/m. As the phases often tend to get non-consecutive numbering it's hard to keep track when having a lot of phases in the calculation. Is there a way to have the results from the script print the ID of the phase (i.e. the name that I have given the phase) instead of the phase number?

Grateful for any assistance