Macro Looping

I am trying to loop a macro the same number of times as the number of cues in a cuelist. I know that in the about menu there is a number of cues counter. Does anybody know if there is a way to reference the number of cues listed in about or if there is a way to query the number of cues in a cuelist. I can achieve what I need with an infinite loop but would like it if the macro can stop looping when it gets to the end of the cuelist.

My macro so far is as follows:

Go_To_Cue Out Time 0 [ENTER]

Go_To_Cue 1/ Time 0 [ENTER]

Clear_CmdLine Blind Blind Cue [ENTER]

Clear_CmdLine Clear_CmdLine Clear_CmdLine [ENTER]

Macro_Loop_Begin 0 Select_Active Mark Earliest [ENTER]

Clear_CmdLine Next Macro_Loop_End

This macro is mainly to quickly ensure everything is marked at the end of early tech sessions ready for mark times/cues to be changed in later sessions. 

Related