[shell] Open file when Audacity is already running

Hello.

I am using:

  • Audacity 2.0.5
  • Ubuntu 14.04.2 LTS

I open audio files with this command:

audacity filename1.wav &

Whenever I want to open a second file from the command line, I get the error message:

“The System has detected that another copy of Audacity is running. Running two copies of Audacity simultaneously may cause data loss or cause your system to crash. Use the new or open commands in the currently running Audacity process to open multiple projects simultaneously.”

I understand the message. How do I open another file in the current Audacity session? The Audacity man page is very brief.

Open it from the GUI.
Either “File menu > New” or the shortcut “Ctrl + N”.

I would like to open it from the command line.

I use Audacity to inspect results from my simulations and, thus, it is invoked from my simulation software.

Is opening a second file from the command line in the same session impossible?

The only built in way to open multiple projects from the command line is to specify a number of files:
audacity …

It may be possible to do what you want using the scripting module “mod-script-pipe”. This module is only available as source code. More information here: Audacity Manual

Alternatively you may be able to script a solution using a third party application such as AutoKey

Thank you, for the details.

For now, I will open many files at once, as you suggested. I will check how long it takes me to compile the pipe module.

This was a long-standing bug, but it is believed mostly or completely fixed with 2.1.0 release if you would like to build that from our source tarball Audacity ® | Free, open source, cross-platform audio software for multi-track recording and editing.. Uninstall the 2.0.5 packaged version of Audacity first if you do that.

If you build Audacity HEAD 2.1.1-alpha (see GitHub - Audacity Wiki), you’ll currently need to specify the full path to the files due to a recently introduced bug.

I can’t see the point using mod-script-pipe for the case you mentioned. To use mod-script-pipe you’ll have to build Audacity and if you build 2.1.0 or 2.1.1-alpha the problem should be fixed.

Please let us know of any problems you find with command-line file opening if you test 2.1.x versions.


Gale