Is there a way to keep a macro from overwriting an exported mp3 file?

I’ve been trying to make a macro that exports separate 30-second clips of an audio file into different files and the macro keeps overwriting it.

I program this requirement outside Audacity 3.1.3/Win10. because I know little of the tools that work within the sphere of Audacity (Nyqist et al.)
I made use of Win10/DOS/Batch files.
I can perform an Audacity macro process on a series of individually named tracks by programming a BATch file to copy the files one at a time to a fixed file name, have Audacity process that fixed file name to another fixed file name, then back in the batch file, copy the processed file to a suitable target.

FOR %A in (*.*) DO SomeProcess.BAT

Not the most elegant solution I concede, but while it is running I can hang out the washing or start mixing dough for a new loaf of bread …
It does have the advantage of reloading Audacity for each file, so that tricky things like Audacity’s Noise Reduction work as I want it to.
Cheers
Chris

Audacity’s macros provide a list of commands. If you need to use conditional logic, branching, or any other programming feature beyond a simple list of commands, then you need to use a more flexible programming language (such as Nyquist, Python, DOS, bash, …).

Audacity has the Nyquist programming language built in, and Nyquist supports Audacity’s macro commands, which gives you “Nyquist Macros”. See: https://manual.audacityteam.org/man/nyquist_macros.html