Batch Processing - two distinct modes of operation

Win10/3.1.3
Two meanings are associated with this term:
(1) The sense in Audacity 3.1.3 by using Tools, Apply macro, Palette, Files
(2) The sense of running a Windows Batch file or similar script to make use of iteration, recursion, and conditional statements.
In the first case, an “Export” command is recommended as the last step in the macro to be applied. Your output folders may be critical in these cases.
In the second case, an “Exit” command or macro is recommended, otherwise we will leave as many Audacity projects lying around as we have files to process.

Suppose we write an Audacity macro to process a recording of the spoken voice; reading pages of a chapter, or chapters of a book.
The Audacity macro will look something like this:-
AuMac062.png
This Audacity macro can be run by Tools, Apply macro, Files, at which time we are prompted for a folder into which we have placed all the audio files to be processed. This presupposes that we have managed to collect, and are prepared to disperse to their original folders, a set of files from the hard drive.

An alternative version of the macro to be driven from an operating system batch file would look like this:-
AuMac061.png
Note the extra command to Import a standard-named file, and the extra command to exit Audacity.

These two Audacity macros are simplified for examples; the full macros may be a dozen lines - or more.

The Windows/DOS batch files to process all the files in a folder will look something like this:-
AuMac060.png
Of course, a parent batch file could invoke the “Assemble2_0” batch file from a variety of folders on the hard drive, removing the need to collect and disperse audio files from various locations.

To the best of my knowledge there is no “AutoStart/AutoOpen/AutoExec” facility in Audacity, so the user needs to issue a shortcut keystroke to invoke the Audacity macro for each file.

It seems to me that if a user wants to make use of both Audacity batch processing and the Operating System scripting facility (to make use of iteration, recursion, and conditional statements), then the user will need two versions of each macro.

Cheers
Chris

I don’t know what you mean by “AutoStart/AutoOpen/AutoExec”, but if you use a language that supports “named pipes” then you can send the name of a macro to Audacity to run that macro. I don’t know if Windows BAT files support named pipes, but I think Windows PowerShell does (as does Python, Perl, Bash, and many other scripting languages).

There’s some information in the Audacity manual about using scripting commands with named pipes here: https://manual.audacityteam.org/man/scripting.html
The commands are the same as are used by Audacity’s macros.
The recommended scripting language (the only one that we provide support for) is Python3.

Thank you, Steve. DOS (batch) commands support piping, but it is crude, essentially the vertical bar (|) passes the output of one command to the next command in the command line, on, and on etc. But since Audacity (best of my knowledge) doesn’t accept command-line parameters, DOS piping will just crash into the breakwater.

I meant “AutoExec” as used when a PC boots into DOS or Windows - a batch file that is sought by the O/S, or for example, and AutoEexc macro written in Word/VBA which (macro) is recognised by MSWord when the program is loaded.

In plain Vanilla Audacity, one cannot have a macro with a reserved name (AutoExec would serve as well as any other) that is recognized by Audacity when it fires up.

As for Python et al, I know that I will need to get in there if I want to do advanced macros, but for now I am trying to keep it simple by restricting myself to Audacity commands because my target audience (LibriVox) almost certainly don’t want to have “strange” languages added into their mix. It is an uphill struggle to face people who enjoy tweaking wave forms “manually” with a mouse, one second at a time, when a single Audacity command or macro could reduce the job from two hours to two seconds. (“But I LIKE paying attention to detail …”)

Cheers
Chris

That’s a different and unrelated use of the word “pipe” (the name of the vertical bar character is “pipe” https://en.wikipedia.org/wiki/Vertical_bar).
“Named pipes” are described here: https://en.wikipedia.org/wiki/Named_pipe

René-Magritte_The-Treachery-of-Images.jpg