Select Track Macro Troubles

Having troubles with this macro. It selects all tracks and applies the normalization and limiter. Expected behavior is to apply normalization and limiter to only the first track.

Note: The track 9 stuff at the end works as expected.

SelectTracks:Mode="Set" Track="0" TrackCount="1"
Normalize:ApplyGain="1" PeakLevel="0" RemoveDcOffset="0" StereoIndependent="0"
Limiter:gain-L="0" gain-R="0" hold="10" makeup="Yes" thresh="-5" type="SoftLimit"
SelectTracks:Mode="Set" Track="9" TrackCount="1"
SelectTime:End="14.4132" RelativeTo="SelectionStart" Start="0"
AdjustableFade:curve="100" gain0="16" gain1="0" preset="None" type="Down" units="dB"

Your script does not make a time selection before the “Normalize:” command.
“SelectTracks:” only selects the track numbers, not the time region selected.

If you manually select a time region before running the script, “Normalize:” and “Limiter” will be applied to that time region in the first track, and then change the selection so that it has a duration of 14.4132 starting from the beginning of the selection.

If you run the script without a time selection, then the default behaviour when running effects is to select the entire project, which is what you are describing.

If you want the script to apply Normalize and Limiter to all of the first track, then the easiest solution is to add a “SelectAll:” before the first track selection

SelectAll:
SelectTracks:Mode="Set" Track="0" TrackCount="1"
Normalize:ApplyGain="1" PeakLevel="0" RemoveDcOffset="0" StereoIndependent="0"
Limiter:gain-L="0" gain-R="0" hold="10" makeup="Yes" thresh="-5" type="SoftLimit"
SelectTracks:Mode="Set" Track="2" TrackCount="1"
SelectTime:End="14.4132" RelativeTo="SelectionStart" Start="0"
AdjustableFade:curve="100" gain0="16" gain1="0" preset="None" type="Down" units="dB"

Yup that’s it. Thanks. Didn’t realize have to select time range too. Figured select track was analogous to selecting a track in the GUI (click the track left control pane) where it selects the entire track.

Is there away to apply the limiter to all tracks without it appending to make the shorter tracks the same length as the longest track?
Obviously can do them each individually. But that makes for a more cumbersome macro.

Short answer: No.

It’s because the Limiter is a “Nyquist plug-in”.
“Nyquist” is a programming language that is built into Audacity. When a Nyquist effect plug-in runs, Audacity passes the selection, one track at a time, to the Nyquist interpreter. Nyquist sees the start and stop times of the sound as the start and end of the selection, so any “empty” selected track space is treated as “silence” (silent audio).

It would be “possible” to modify the Limiter effect so that it strips off the “empty” space beyond the end of the audio, though this could cause problems if the track selection is very long, because on Windows, Nyquist only has access to 2GB of RAM.

Well it probably isn’t worth quite that much effort. Besides a lot of tracks actually end with some amount of desired silence.