Make Stereo Track?

Is it possible to join two mono tracks into a stereo track when scripting?

The description of the “TrackMenu:” command says “[…]In the audio track dropdown, use Up, and Down, arrow keys to navigate the menu and Enter, to select a menu item.[…]”

How can I do this via the named pipe commands?

I also saw there is a “Drag:” command that moves the mouse. Can I use this to click “Make Stereo Strack” after using “TrackMenu:”? The description of “Drag:” says “This IS an experimental command, and it is tricky to use effectively. It is best to look at example scripts to see how it can be used.”, so I don’t know if this would be the recommended approach. Also I didn’t find how to do a click after moving the mouse.

Are there commands to use the keyboard, or even better a command to directly apply “Make Stereo Track” via named pipe command?

(using 3.1.3)

Yes, but only by panning one mono track left, and the other right, then selecting both tracks and mixing.

Thank you, I think it works. If anyone else needs this, I did it with the following commands:

FirstTrack:
TrackPanLeft:
TrackPanLeft:
TrackPanLeft:
TrackPanLeft:
TrackPanLeft:
TrackPanLeft:
TrackPanLeft:
TrackPanLeft:
TrackPanLeft:
TrackPanLeft:
NextTrack:
TrackPanRight:
TrackPanRight:
TrackPanRight:
TrackPanRight:
TrackPanRight:
TrackPanRight:
TrackPanRight:
TrackPanRight:
TrackPanRight:
TrackPanRight:
ShiftUp:
MixAndRender:

A simpler way would be to use the “PanLeft” and “PanRight” commands. These pan the selected track(s) all the way left / right.
(The commands reference is here: Scripting Reference - Audacity Manual)

Hm, for some reason “PanLeft” was applied on the second track even though I used it after the “FirstTrack” command. “TrackPanLeft” on the other hand was applied to the first track, as I intended. Reading the reference gets me a bit confused regarding if there are diferences between selected and focused tracks (and/or audio?).

Yes the scripting documentation could be improved. Most of that documentation was automagically generated. It’s necessary to experiment and “play” with the scripting commands.

If the project has only two (mono) tracks, then this should work:

SelectTracks:Mode="Set" Track="0" TrackCount="1"
PanLeft:
SelectTracks:Mode="Set" Track="1" TrackCount="1"
PanRight:
SelectAll:
MixAndRender:

Perfect, thanks!