Optimizing "TimerRecord:" for use in Macros

I would like to record with a Macro but to do so with the current implementation, several features are needed. In particular, I want to trigger a record, stop, then do further processing (effects, export…). To do so I could use an event trigger or TimerRecord.

First, let me explain the trigger. A trigger can be used in a few ways, I can record with a selection and wait for a stop event (trigger:name=“stop”) and then proceed. Alternatively, I can wait() (wait:length=“{time}”) and proceed execution of the Macro once completed. I need the recording to be of a dynamic length so unless I have access to variables within Macros I would use the first method. I don’t expect this to implemented any time soon as (to the best of my understanding) there is no concept of events in Audacity.

Second, is to use TimerRecord as it’s a blocking action so there are no issues of asynchronous actions. Currently, I can manually add TimerRecord: to a Macro via the .txt file. It works but it seems TimerRecord: is a command to launch a dialog and not the action itself and that’s what it does. So the feature request is to expose the properties and run the action for Macros, as well as to add an option for the Duration to be obtained through what’s currently selected (or/and stored position) so the duration can be dynamic.

Audacity’s Macros are intentionally “just a list” of commands.

Yes, there could be features added to implement conditional commands, variables, and other programming features, but the developers decided that they will not take this approach. Instead, Macros will remain as a simple list of commands that runs in sequence, and for more advanced programming, a proper programming language can be used. The recommended language is Python 3. See: https://manual.audacityteam.org/man/scripting.html