How to trim using macro?

I need to use a macro to batch process audio files and remove the silence at the beginning and ending of the audio tracks. I don’t want to remove any silence within the audio. How can I do this?

v3.0.0
Windows 10

Maybe not with a Macro. Macros can’t make decisions and as far as I know, they can’t address specific parts of a sound file. They’re good for calling tools in order.

Run Amplify > Run Compressor > Run Tone Controls > Stop.

I think lately, you can make them open a file, run some tools and save a file, but I think that’s it. Even that can cause problems because I don’t think you can change the filename—but somebody will correct me.

Koz

There’s a Nyquist plug-in for that: Missing features - Audacity Support

See here for downloading and installing Nyquist plug-ins: Missing features - Audacity Support

Asuming the silence at the begining and at the end is not too long, this should do it:

Select:End=“0.200000” Mode=“Set” Start=“0”
TruncateSilence:Action=“Truncate Detected Silence” Compress=“50” Independent=“0” Minimum=“0.030000” Threshold=“-40” Truncate=“0.004000”
Select:End=“0.400000” Mode=“Set” RelativeTo=“ProjectEnd” Start=“0”
TruncateSilence:Action=“Truncate Detected Silence” Compress=“50” Independent=“0” Minimum=“0.030000” Threshold=“-40” Truncate=“0.004000”