Loop macros

I split audio by silence.
Now I want to set label to every fragment(clip) splitted audio.
After it, I want to save every fragment to wav file.

My question:
How can I organize next loop?

CursTrackStart,
SetPlayRegionIn,
SetPlayRegionOut,
TogglePlayRegion,
SelNextClip,
AddLabel.

I get right only first clip.

Please, tell me right sequence commands.

Macros don’t do looping or branching. Macros are just a list of commands that run from the start of the list to the end of the list.

For more complex programming (including looping, branching and conditionals) you need to use a programming language such as Nyquist (built into Audacity) or and external language such as Python.
See: Nyquist - Audacity Manual
and: Scripting - Audacity Manual


The easiest way is:

  1. Double click on the first clip
  2. “Ctrl +B” then “Enter” (labels the first clip)
  3. “Alt + .” (select the next clip)
  4. Repeat from step 2

Then use “Export Multiple” based on labels. See: Exporting multiple audio files - Audacity Manual

Many thanks!