There’s no easy way of doing that. It is “possible”, but you would need to write two Nyquist scripts (see Nyquist - Audacity Manual), one to analyse the track and work out the times of the selections, and another to make the selections, then incorporate those two scripts into the macro.