Export2 Macro Usability Issue

I’m running Audacity 3.1.3 on Ubuntu 22.04 (via Flatpak, if it makes a difference), and I noticed that the the Export2 macro was creating a blank file. If I tried to export the file using the standard pull-down menu, it worked file:

However, I have the following macro:

When I ran it on my file, what I got is this:

What I ultimately figured out was that I had to have the audio I wanted to export selected/highlighted first. Is this by design? I expected Export2 to work the same way as the File → Export → Export Audio… command, which does not require any selection of the audio. I could see a lot of people struggling to figure out this solution.

Yes I think it is.

Sometimes you may want to export everything, and sometimes you may want to export a selection. There “could” have been separate commands for “ExportAll2” and “ExportSelection2”, but there’s hardly any need when you can export all by simply selecting all before Export2:

Imo, the “problem” is that the documentation is rather sparse.

Agreed. Can we get a note about this added to the documentation for Export2?

I’ve updated the alpha-manual entry for “Export2” (https://alphamanual.audacityteam.org/man/Scripting_Reference)
It now says:

Exports selected audio to a named file…

However, the new development team will be discontinuing the manual at some point, and replacing it with a new support channel: https://support.audacityteam.org/